From fba40f6add90bf3de1240fc80b56a6668d7835c6 Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Mon, 5 Oct 2015 17:33:01 +0100 Subject: [PATCH] JAL-1912 added null check for SequenceMapping variable at the point of reference --- src/jalview/datamodel/AlignmentAnnotation.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index 9c3af27..01926dc 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -959,8 +959,12 @@ public class AlignmentAnnotation public void adjustForAlignment() { - if (sequenceRef == null || sequenceMapping == null - || annotations == null) + if (sequenceRef == null) + { + return; + } + + if (annotations == null) { return; } @@ -980,7 +984,7 @@ public class AlignmentAnnotation for (a = sequenceRef.getStart(); a <= sequenceRef.getEnd(); a++) { index = new Integer(a); - if (sequenceMapping.containsKey(index)) + if (sequenceMapping != null && sequenceMapping.containsKey(index)) { position = sequenceRef.findIndex(a) - 1; -- 1.7.10.2