catch AttributeError in plotTreeView double click event

This commit is contained in:
Megan Conners 2022-02-19 11:41:19 -05:00
parent 9e8e7a234f
commit 6fd6a68d9d

View file

@ -201,5 +201,8 @@ class plotTreeView(QTreeWidget):
def mouseDoubleClickEvent(self, event):
item = self.currentItem()
# Catching double clicks to forbid collapsing of toplevel items
if item.parent():
QTreeWidget.mouseDoubleClickEvent(self, event)
try:
if item.parent():
QTreeWidget.mouseDoubleClickEvent(self, event)
except AttributeError:
pass