From 7d079aa08995fcdea523721b8cdaa3c5c5d862f1 Mon Sep 17 00:00:00 2001 From: Daniel Cameron Date: Fri, 4 Feb 2022 14:06:03 +1100 Subject: [PATCH] Fixed NPE --- src/main/java/au/edu/wehi/idsv/DirectedEvidenceOrder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/au/edu/wehi/idsv/DirectedEvidenceOrder.java b/src/main/java/au/edu/wehi/idsv/DirectedEvidenceOrder.java index 5d0c9589..ee34606e 100644 --- a/src/main/java/au/edu/wehi/idsv/DirectedEvidenceOrder.java +++ b/src/main/java/au/edu/wehi/idsv/DirectedEvidenceOrder.java @@ -41,8 +41,10 @@ public int compare(DirectedEvidence arg1, DirectedEvidence arg2) { .compare(arg1_nominal2, arg2_nominal2) .result(); if (cmp != 0) return cmp; - cmp = BySAMStart.compare(arg1, arg2); - if (cmp != 0) return cmp; + if (arg1.getUnderlyingSAMRecord() != null && arg2.getUnderlyingSAMRecord() != null) { + cmp = BySAMStart.compare(arg1, arg2); + if (cmp != 0) return cmp; + } return arg1.getEvidenceID().compareTo(arg2.getEvidenceID()); } };