From: gmungoc Date: Wed, 22 Jun 2016 12:59:35 +0000 (+0100) Subject: JAL-1982 defensive test for null array of annotations X-Git-Tag: Release_2_10_0~159^2~3 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f45b2d150315264f33869837a680667192acc421;p=jalview.git JAL-1982 defensive test for null array of annotations --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index bfbc969..133aab4 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -5960,8 +5960,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, protected void setAnnotationsVisibility(boolean visible, boolean forSequences, boolean forAlignment) { - for (AlignmentAnnotation aa : alignPanel.getAlignment() - .getAlignmentAnnotation()) + AlignmentAnnotation[] anns = alignPanel.getAlignment() + .getAlignmentAnnotation(); + if (anns == null) + { + return; + } + for (AlignmentAnnotation aa : anns) { /* * don't display non-positional annotations on an alignment