From: jprocter Date: Wed, 2 May 2007 12:19:55 +0000 (+0000) Subject: checks for negative start column in restrict X-Git-Tag: Release_2_3~85 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a3b3c4269d29f085e573cbeb731f3fb5dfb7b0c9;p=jalview.git checks for negative start column in restrict --- diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index cc4308d..3ed84a3 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -357,12 +357,18 @@ Loading... */ public void restrict(int startRes, int endRes) { + if (startRes<0) + startRes=0; + if (startRes>=annotations.length) + startRes = annotations.length-1; + if (endRes>=annotations.length) + endRes = annotations.length-1; if (annotations==null) return; Annotation[] temp = new Annotation[endRes-startRes+1]; if (startRes