diff --git a/manuskript/ui/views/plotTreeView.py b/manuskript/ui/views/plotTreeView.py index b325dc86..97c46fc8 100644 --- a/manuskript/ui/views/plotTreeView.py +++ b/manuskript/ui/views/plotTreeView.py @@ -200,9 +200,9 @@ class plotTreeView(QTreeWidget): def mouseDoubleClickEvent(self, event): item = self.currentItem() + if not item: + return + # Catching double clicks to forbid collapsing of toplevel items - try: - if item.parent(): - QTreeWidget.mouseDoubleClickEvent(self, event) - except AttributeError: - pass + if item.parent(): + QTreeWidget.mouseDoubleClickEvent(self, event)