浏览代码

wxGUI vdigit: fix Undo/Redo tool when no map edited (#586)

Tomas Zigo 5 年之前
父节点
当前提交
062b8af02d
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      gui/wxpython/vdigit/toolbars.py

+ 4 - 2
gui/wxpython/vdigit/toolbars.py

@@ -495,13 +495,15 @@ class VDigitToolbar(BaseToolbar):
 
     def OnUndo(self, event):
         """Undo previous changes"""
-        self.digit.Undo()
+        if self.digit:
+            self.digit.Undo()
 
         event.Skip()
 
     def OnRedo(self, event):
         """Undo previous changes"""
-        self.digit.Undo(level=1)
+        if self.digit:
+            self.digit.Undo(level=1)
 
         event.Skip()