Stop lookup error on none in project tree meta panel

This commit is contained in:
Veronica K. B. Olsen
2021-02-02 16:36:45 +01:00
parent 5654170278
commit 6949481198
+6 -3
View File
@@ -227,13 +227,16 @@ class GuiItemDetails(QWidget):
def updateViewBox(self, tHandle): def updateViewBox(self, tHandle):
"""Populate the details box from a given handle. """Populate the details box from a given handle.
""" """
self.theHandle = tHandle if tHandle is None:
nwItem = self.theProject.projTree[tHandle] self.clearDetails()
return
nwItem = self.theProject.projTree[tHandle]
if nwItem is None: if nwItem is None:
self.clearDetails() self.clearDetails()
return
else: self.theHandle = tHandle
theLabel = nwItem.itemName theLabel = nwItem.itemName
if len(theLabel) > 100: if len(theLabel) > 100:
theLabel = theLabel[:96].rstrip()+" ..." theLabel = theLabel[:96].rstrip()+" ..."