From: amwaterhouse Date: Thu, 26 Oct 2006 12:17:51 +0000 (+0000) Subject: check command.string[i] is not null X-Git-Tag: Release_2_2~217 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4fa6578776dc7eb65dd5d86ccfb7c0b5d377b81c;p=jalview.git check command.string[i] is not null --- diff --git a/src/jalview/commands/EditCommand.java b/src/jalview/commands/EditCommand.java index a53798a..125cb93 100644 --- a/src/jalview/commands/EditCommand.java +++ b/src/jalview/commands/EditCommand.java @@ -200,11 +200,16 @@ public class EditCommand implements CommandI for(int i=0; icommand.position) + { + command.string[i] = command.seqs[i].getSequence(command.position, + command.position + command.number); + + System.out.println("CUT:"+command.string[i]+":"); - command.seqs[i].deleteChars(command.position, - command.position+command.number); + command.seqs[i].deleteChars(command.position, + command.position + command.number); + } if(command.seqs[i].getLength()<1) { @@ -229,7 +234,8 @@ public class EditCommand implements CommandI command.al.addSequence(command.seqs[i]); } tmp = new StringBuffer(command.seqs[i].getSequence()); - if(command.string!=null) + + if(command.string!=null && command.string[i]!=null) { tmp.insert(command.position, command.string[i]); command.string[i] = null;