bugfix for deleted annotation undo
[jalview.git] / src / jalview / commands / EditCommand.java
index 4cd5992..cbcc700 100644 (file)
@@ -472,7 +472,11 @@ public class EditCommand
       }
 
       int tSize = 0;
-
+      if (annotations[a].annotations == null)
+      {
+        // nothing to edit here ?
+        continue;
+      }
       aSize = annotations[a].annotations.length;
       if (insert)
       {
@@ -573,7 +577,7 @@ public class EditCommand
                            0, temp, 0, copylen); //command.position);
 
           Annotation[] deleted = new Annotation[command.number];
-          if (copylen>command.position) {
+          if (copylen>=command.position) {
             copylen = Math.min(command.number, annotations[a].annotations.length-command.position);
             if (copylen>0)
             {