JAL-1912 added null check for SequenceMapping variable at the point of reference
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Mon, 5 Oct 2015 16:33:01 +0000 (17:33 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Mon, 5 Oct 2015 16:33:01 +0000 (17:33 +0100)
src/jalview/datamodel/AlignmentAnnotation.java

index 9c3af27..01926dc 100755 (executable)
@@ -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;