From 5ef242d44b8db9edeae9523ad76a5065cb6ef999 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 31 May 2013 17:09:33 +0100 Subject: [PATCH] JAL-1259 patch to avoid NPE --- src/jalview/datamodel/Alignment.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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, -- 1.7.10.2