From: Jim Procter Date: Fri, 31 May 2013 16:09:33 +0000 (+0100) Subject: JAL-1259 patch to avoid NPE X-Git-Tag: Jalview_2_9~250 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9639e7f64e28909a2cc91864ff7399115a844464;p=jalview.git JAL-1259 patch to avoid NPE --- diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 83aab4e..1553710 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -1385,13 +1385,17 @@ public class Alignment implements AlignmentI SequenceGroup groupRef) { assert (name != null); - for (AlignmentAnnotation annot : getAlignmentAnnotation()) + if (annotations != null) { - if (annot.autoCalculated == autoCalc && (name.equals(annot.label)) - && (calcId == null || annot.getCalcId().equals(calcId)) - && annot.sequenceRef == seqRef && annot.groupRef == groupRef) + for (AlignmentAnnotation annot : getAlignmentAnnotation()) { - return annot; + if (annot.autoCalculated == autoCalc && (name.equals(annot.label)) + && (calcId == null || annot.getCalcId().equals(calcId)) + && annot.sequenceRef == seqRef + && annot.groupRef == groupRef) + { + return annot; + } } } AlignmentAnnotation annot = new AlignmentAnnotation(name, name,