Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix empty selection model bug (#2173)
Browse files Browse the repository at this point in the history
vkbo committed Jan 11, 2025
1 parent 4b79b2b commit ec12b45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion novelwriter/gui/projtree.py
Original file line number Diff line number Diff line change
@@ -1020,7 +1020,9 @@ def _onNodeExpanded(self, index: QModelIndex) -> None:
def _clearSelection(self) -> None:
"""Clear the currently selected items."""
self.clearSelection()
self.selectionModel().clearCurrentIndex()
if model := self.selectionModel():
# Selection model can be None (#2173)
model.clearCurrentIndex()
return

def _selectedRows(self) -> list[QModelIndex]:

0 comments on commit ec12b45

Please sign in to comment.