From 4638ba878f6fb9c9e1c21dfe03a80e854f61544b Mon Sep 17 00:00:00 2001 From: Windspar Date: Sun, 18 Feb 2018 14:06:33 -0500 Subject: [PATCH] stop crash when click btnGoUp and current editor is None --- manuskript/ui/editors/mainEditor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manuskript/ui/editors/mainEditor.py b/manuskript/ui/editors/mainEditor.py index 34557c8b..305b9636 100644 --- a/manuskript/ui/editors/mainEditor.py +++ b/manuskript/ui/editors/mainEditor.py @@ -197,8 +197,9 @@ class mainEditor(QWidget, Ui_mainEditor): self.setCurrentModelIndex(i, newTab) def goToParentItem(self): - idx = self.currentEditor().currentIndex - self.mw.treeRedacOutline.setCurrentIndex(idx.parent()) + if self.currentEditor(): + idx = self.currentEditor().currentIndex + self.mw.treeRedacOutline.setCurrentIndex(idx.parent()) def setCurrentModelIndex(self, index, newTab=False, tabWidget=None):