Remove group if sequences are null
authoramwaterhouse <Andrew Waterhouse>
Wed, 6 Jul 2005 12:21:25 +0000 (12:21 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 6 Jul 2005 12:21:25 +0000 (12:21 +0000)
src/jalview/datamodel/Alignment.java

index 28849b6..61735ee 100755 (executable)
@@ -334,9 +334,16 @@ public class Alignment implements AlignmentI
     {\r
         Vector temp = new Vector();\r
 \r
-        for (int i = 0; i < this.groups.size(); i++)\r
+        int gSize = groups.size();\r
+        for (int i = 0; i < gSize; i++)\r
         {\r
             SequenceGroup sg = (SequenceGroup) groups.elementAt(i);\r
+            if(sg==null || sg.sequences==null)\r
+            {\r
+              this.deleteGroup(sg);\r
+              gSize--;\r
+              continue;\r
+            }\r
 \r
             if (sg.sequences.contains(s))\r
             {\r