avoid exception if search returns valid object but does not match any sequences
authorjprocter <Jim Procter>
Wed, 12 Nov 2008 11:09:01 +0000 (11:09 +0000)
committerjprocter <Jim Procter>
Wed, 12 Nov 2008 11:09:01 +0000 (11:09 +0000)
src/jalview/analysis/Finder.java

index 756897c..9f813b5 100644 (file)
@@ -111,7 +111,7 @@ public class Finder
     {
       seq = (Sequence) alignment.getSequenceAt(seqIndex);
 
-      if ((selection != null)
+      if ((selection != null && selection.getSize()>0)
               && !selection.getSequences(null).contains(seq))
       {
         seqIndex++;
@@ -157,7 +157,7 @@ public class Finder
         {
           resIndex = regex.matchedFrom();
 
-          if ((selection != null)
+          if ((selection != null && selection.getSize()>0)
                   && ((resIndex + Integer.parseInt(spaces.elementAt(
                           resIndex).toString())) < selection.getStartRes()))
           {