From 4f3aa2d5b87614be76e66ab42f525b439378b850 Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 12 Nov 2008 11:09:01 +0000 Subject: [PATCH] avoid exception if search returns valid object but does not match any sequences --- src/jalview/analysis/Finder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jalview/analysis/Finder.java b/src/jalview/analysis/Finder.java index 756897c..9f813b5 100644 --- a/src/jalview/analysis/Finder.java +++ b/src/jalview/analysis/Finder.java @@ -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())) { -- 1.7.10.2