void checkValidRange()
{
- if (end < 1)
+ // Note: JAL-774 : http://issues.jalview.org/browse/JAL-774?focusedCommentId=11239&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-11239
{
int endRes = 0;
for (int j = 0; j < sequence.length; j++)
endRes += start - 1;
}
- this.end = endRes;
+ if (end<endRes) {
+ end = endRes;
+ }
}
}
// returns the alignment position for a residue
int j = start;
int i = 0;
-
+ // Rely on end being at least as long as the length of the sequence.
while ((i < sequence.length) && (j <= end) && (j <= pos))
{
if (!jalview.util.Comparison.isGap(sequence[i]))