From dc955cdf7c38c71d0b59ad494139813678bcf2fe Mon Sep 17 00:00:00 2001 From: Ivan Holmes Date: Tue, 22 Sep 2020 17:30:37 +0100 Subject: [PATCH] Fix crash on saving new file (severe) --- gui.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gui.py b/gui.py index 1042b82..a9a3840 100755 --- a/gui.py +++ b/gui.py @@ -339,11 +339,11 @@ class DocumentWindow(QMainWindow): def menuFileSaveAction(self): self.updateDocument() - fileExt = os.path.splitext(self.currentFilePath)[1].lower() - - if self.currentFilePath and fileExt != ".cma": - # Chordsheet Macro files can't be saved at this time - self.saveFile(self.currentFilePath) + if self.currentFilePath: + fileExt = os.path.splitext(self.currentFilePath)[1].lower() + if fileExt != ".cma": + # Chordsheet Macro files can't be saved at this time + self.saveFile(self.currentFilePath) else: filePath = QFileDialog.getSaveFileName(self.window.tabWidget, 'Save file', self.getPath( "workingPath"), "Chordsheet ML files (*.xml *.cml)")[0]