Check if hiddenSequence has been deleted
authoramwaterhouse <Andrew Waterhouse>
Thu, 26 Oct 2006 09:39:01 +0000 (09:39 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 26 Oct 2006 09:39:01 +0000 (09:39 +0000)
src/jalview/datamodel/HiddenSequences.java

index 9a4e7c6..31eda50 100755 (executable)
@@ -73,9 +73,12 @@ public class HiddenSequences
 \r
     for (int i = 0; i < hiddenSequences.length; i++)\r
     {\r
+      if(hiddenSequences[i]==null)\r
+        continue;\r
+\r
       if (i > deletionIndex)\r
         tmp[i-1] = hiddenSequences[i];\r
-      else if(hiddenSequences[i]!=null)\r
+      else\r
        tmp[i] = hiddenSequences[i];\r
     }\r
 \r
@@ -158,12 +161,17 @@ public class HiddenSequences
 \r
       if(seq!=null)\r
       {\r
-        revealedSeqs.addElement(seq);\r
-        alignment.getSequences().insertElementAt(seq, alignmentIndex);\r
-        if(repSequence!=null)\r
-        {\r
-          repSequence.showHiddenSequence(seq);\r
-        }\r
+        if(seq.getLength()>0)\r
+         {\r
+           revealedSeqs.addElement(seq);\r
+           alignment.getSequences().insertElementAt(seq, alignmentIndex);\r
+         }\r
+         else\r
+           System.out.println(seq.getName()+" has been deleted");\r
+         if (repSequence != null)\r
+         {\r
+           repSequence.showHiddenSequence(seq);\r
+         }\r
       }\r
 \r
     }\r