From 4fa6578776dc7eb65dd5d86ccfb7c0b5d377b81c Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 26 Oct 2006 12:17:51 +0000 Subject: [PATCH] check command.string[i] is not null --- src/jalview/commands/EditCommand.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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; -- 1.7.10.2