JAL-1492 formatting and squash NPEs
authorJim Procter <jprocter@dundee.ac.uk>
Thu, 1 May 2014 14:41:20 +0000 (15:41 +0100)
committerJim Procter <jprocter@dundee.ac.uk>
Thu, 1 May 2014 14:41:20 +0000 (15:41 +0100)
src/jalview/datamodel/SequenceGroup.java

index 1df45a2..a8b0ace 100755 (executable)
@@ -1209,11 +1209,15 @@ public class SequenceGroup implements AnnotatedCollectionI
     ArrayList<AlignmentAnnotation> annot = new ArrayList<AlignmentAnnotation>();
     for (SequenceI seq : (Vector<SequenceI>) sequences)
     {
-      for (AlignmentAnnotation al : seq.getAnnotation())
+      AlignmentAnnotation[] aa = seq.getAnnotation();
+      if (aa != null)
       {
-        if (al.groupRef == this)
+        for (AlignmentAnnotation al : aa)
         {
-          annot.add(al);
+          if (al.groupRef == this)
+          {
+            annot.add(al);
+          }
         }
       }
     }