diff --git a/gui.py b/gui.py index 70169da..a0b2736 100755 --- a/gui.py +++ b/gui.py @@ -509,12 +509,12 @@ class DocumentWindow(QMainWindow): self.window.chordTableView.populate(self.doc.chordList) # remove the chord if any of the blocks have it attached - for s in self.doc.sectionList: - for b in s.blockList: - if b.chord: - if b.chord.name == oldName: - b.chord = None - if self.currentSection.blockList is not None: + if self.currentSection is not None: + for s in self.doc.sectionList: + for b in s.blockList: + if b.chord: + if b.chord.name == oldName: + b.chord = None self.window.blockTableView.populate(self.currentSection.blockList) self.clearChordLineEdits() self.updateChordDict()