JAL-2780 JAL-2781 - patch and first test for AlignmentI.findOrCreateAnnotation
[jalview.git] / src / jalview / datamodel / Alignment.java
index f268d37..97947b6 100755 (executable)
@@ -1603,7 +1603,10 @@ public class Alignment implements AlignmentI
     AlignmentAnnotation annot = new AlignmentAnnotation(name, name,
             new Annotation[1], 0f, 0f, AlignmentAnnotation.BAR_GRAPH);
     annot.hasText = false;
-    annot.setCalcId(new String(calcId));
+    if (calcId != null)
+    {
+      annot.setCalcId(new String(calcId));
+    }
     annot.autoCalculated = autoCalc;
     if (seqRef != null)
     {