JAL-2925 handle empty annotation when copying group consensus
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 7 Mar 2018 11:27:20 +0000 (11:27 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 7 Mar 2018 11:27:20 +0000 (11:27 +0000)
src/jalview/datamodel/SequenceGroup.java

index 6b797d7..944f263 100755 (executable)
@@ -1189,9 +1189,10 @@ public class SequenceGroup implements AnnotatedCollectionI
     {
       if (consensus.annotations[i] != null)
       {
-        if (consensus.annotations[i].description.charAt(0) == '[')
+        String desc = consensus.annotations[i].description;
+        if (desc.length() > 1 && desc.charAt(0) == '[')
         {
-          seqs.append(consensus.annotations[i].description.charAt(1));
+          seqs.append(desc.charAt(1));
         }
         else
         {