git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0c40653
)
check command.string[i] is not null
author
amwaterhouse
<Andrew Waterhouse>
Thu, 26 Oct 2006 12:17:51 +0000
(12:17 +0000)
committer
amwaterhouse
<Andrew Waterhouse>
Thu, 26 Oct 2006 12:17:51 +0000
(12:17 +0000)
src/jalview/commands/EditCommand.java
patch
|
blob
|
history
diff --git
a/src/jalview/commands/EditCommand.java
b/src/jalview/commands/EditCommand.java
index
a53798a
..
125cb93
100644
(file)
--- a/
src/jalview/commands/EditCommand.java
+++ b/
src/jalview/commands/EditCommand.java
@@
-200,11
+200,16
@@
public class EditCommand implements CommandI
\r
for(int i=0; i<command.seqs.length; i++)
\r
{
\r
\r
for(int i=0; i<command.seqs.length; i++)
\r
{
\r
- command.string[i] = command.seqs[i].getSequence(command.position,
\r
- command.position + command.number);
\r
+ if(command.seqs[i].getLength()>command.position)
\r
+ {
\r
+ command.string[i] = command.seqs[i].getSequence(command.position,
\r
+ command.position + command.number);
\r
+
\r
+ System.out.println("CUT:"+command.string[i]+":");
\r
\r
\r
- command.seqs[i].deleteChars(command.position,
\r
- command.position+command.number);
\r
+ command.seqs[i].deleteChars(command.position,
\r
+ command.position + command.number);
\r
+ }
\r
\r
if(command.seqs[i].getLength()<1)
\r
{
\r
\r
if(command.seqs[i].getLength()<1)
\r
{
\r
@@
-229,7
+234,8
@@
public class EditCommand implements CommandI
command.al.addSequence(command.seqs[i]);
\r
}
\r
tmp = new StringBuffer(command.seqs[i].getSequence());
\r
command.al.addSequence(command.seqs[i]);
\r
}
\r
tmp = new StringBuffer(command.seqs[i].getSequence());
\r
- if(command.string!=null)
\r
+
\r
+ if(command.string!=null && command.string[i]!=null)
\r
{
\r
tmp.insert(command.position, command.string[i]);
\r
command.string[i] = null;
\r
{
\r
tmp.insert(command.position, command.string[i]);
\r
command.string[i] = null;
\r