JAL-1250 Redundancy removal bug fix for Applet version
[jalview.git] / src / jalview / gui / RedundancyPanel.java
index 693dc37..0e55cf8 100755 (executable)
@@ -258,11 +258,15 @@ public class RedundancyPanel extends GSliderPanel implements Runnable
    */
   public void undoButton_actionPerformed(ActionEvent e)
   {
+    if(historyList == null || historyList.isEmpty()){
+        undoButton.setEnabled(false);
+       return;
+    }
+    
     CommandI command = (CommandI) historyList.pop();
-    command.undoCommand(af.getViewAlignments());
-
     if (ap.av.historyList.contains(command))
     {
+      command.undoCommand(af.getViewAlignments());
       ap.av.historyList.remove(command);
       ap.av.firePropertyChange("alignment", null, ap.av.getAlignment().getSequences());
       af.updateEditMenuBar();