JAL-1492 formatting and squash NPEs
[jalview.git] / 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);
+          }
         }
       }
     }