JAL-1259 patch to avoid NPE
authorJim Procter <jprocter@compbio.dundee.ac.uk>
Fri, 31 May 2013 16:09:33 +0000 (17:09 +0100)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Fri, 31 May 2013 16:24:08 +0000 (17:24 +0100)
src/jalview/datamodel/Alignment.java

index 83aab4e..1553710 100755 (executable)
@@ -1385,13 +1385,17 @@ public class Alignment implements AlignmentI
           SequenceGroup groupRef)
   {
     assert (name != null);
-    for (AlignmentAnnotation annot : getAlignmentAnnotation())
+    if (annotations != null)
     {
-      if (annot.autoCalculated == autoCalc && (name.equals(annot.label))
-              && (calcId == null || annot.getCalcId().equals(calcId))
-              && annot.sequenceRef == seqRef && annot.groupRef == groupRef)
+      for (AlignmentAnnotation annot : getAlignmentAnnotation())
       {
-        return annot;
+        if (annot.autoCalculated == autoCalc && (name.equals(annot.label))
+                && (calcId == null || annot.getCalcId().equals(calcId))
+                && annot.sequenceRef == seqRef
+                && annot.groupRef == groupRef)
+        {
+          return annot;
+        }
       }
     }
     AlignmentAnnotation annot = new AlignmentAnnotation(name, name,