JAL-1982 hotfix to prevent NPE with applet launch on Jpred4 site
authorJim Procter <jprocter@issues.jalview.org>
Wed, 9 Dec 2015 16:03:51 +0000 (16:03 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 9 Dec 2015 16:04:27 +0000 (16:04 +0000)
src/jalview/appletgui/AlignFrame.java

index 50ec7e0..28442a9 100644 (file)
@@ -930,12 +930,15 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
   {
     boolean showForAlignment = showAlignmentAnnotations.getState();
     boolean showForSequences = showSequenceAnnotations.getState();
-    for (AlignmentAnnotation aa : alignPanel.getAlignment()
+    if (alignPanel.getAlignment().getAlignmentAnnotation() != null)
+    {
+      for (AlignmentAnnotation aa : alignPanel.getAlignment()
             .getAlignmentAnnotation())
     {
       boolean visible = (aa.sequenceRef == null ? showForAlignment
               : showForSequences);
       aa.visible = visible;
+      }
     }
     alignPanel.validateAnnotationDimensions(true);
     validate();