fix occasional arrayIndexOutOfBounds when sequences in subgroup are shorter than...
[jalview.git] / src / jalview / analysis / AAFrequency.java
index 46264d6..8fd60c4 100755 (executable)
@@ -211,6 +211,11 @@ public class AAFrequency
     }
     for (int i = iStart; i < width; i++)
     {
+      if (i>=hconsensus.length) {
+        // happens if sequences calculated over were shorter than alignment width
+        consensus.annotations[i]=null;
+        continue;
+      }
       value = 0;
       if (ignoreGapsInConsensusCalculation)
       {