Make sure no menu items crashes the app when there is no project open

This commit is contained in:
Veronica K. B. Olsen
2019-06-08 15:57:22 +02:00
parent 5ff56a2b4b
commit 07244045cc
4 changed files with 58 additions and 30 deletions
+3
View File
@@ -200,6 +200,9 @@ class GuiDocEditor(QTextEdit):
def docAction(self, theAction):
logger.verbose("Requesting action: %s" % theAction.name)
if not self.theParent.hasProject:
logger.error("No project open")
return False
if theAction == nwDocAction.UNDO: self.undo()
elif theAction == nwDocAction.REDO: self.redo()
elif theAction == nwDocAction.CUT: self.cut()