JAL-1737 ignore non-positional annotations for display
[jalview.git] / src / jalview / analysis / AlignmentAnnotationUtils.java
index 9bdbf73..e02aa9e 100644 (file)
@@ -1,9 +1,5 @@
 package jalview.analysis;
 
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.SequenceI;
-import jalview.renderer.AnnotationRenderer;
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.BitSet;
@@ -12,6 +8,10 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.SequenceI;
+import jalview.renderer.AnnotationRenderer;
+
 public class AlignmentAnnotationUtils
 {
 
@@ -63,6 +63,14 @@ public class AlignmentAnnotationUtils
 
     for (AlignmentAnnotation aa : annotations)
     {
+      /*
+       * Ignore non-positional annotations, can't render these against an
+       * alignment
+       */
+      if (aa.annotations == null)
+      {
+        continue;
+      }
       if (forSequences != null
               && (aa.sequenceRef != null && forSequences
                       .contains(aa.sequenceRef)))