From 0c40653e5033e68c8d87955ea9f96879c8114b62 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 26 Oct 2006 12:17:13 +0000 Subject: [PATCH] Sequence length maybe less than end --- src/jalview/commands/ChangeCaseCommand.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jalview/commands/ChangeCaseCommand.java b/src/jalview/commands/ChangeCaseCommand.java index ad5c937..49faa50 100644 --- a/src/jalview/commands/ChangeCaseCommand.java +++ b/src/jalview/commands/ChangeCaseCommand.java @@ -69,14 +69,15 @@ public class ChangeCaseCommand implements CommandI for (int r = 0; r < regions.length; r++) { start = regions[r][0]; - end = regions[r][1]; for (int s = 0; s < seqs.length; s++) { sequence = seqs[s].getSequence(); StringBuffer newSeq = new StringBuffer(); - if (end > sequence.length()) + if (regions[r][1] > sequence.length()) end = sequence.length(); + else + end = regions[r][1]; if (start > 0) { -- 1.7.10.2