From f45b2d150315264f33869837a680667192acc421 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Wed, 22 Jun 2016 13:59:35 +0100 Subject: [PATCH] JAL-1982 defensive test for null array of annotations --- src/jalview/gui/AlignFrame.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 -- 1.7.10.2