From 1a579b336fd9cef521aaad71487f30be401f6768 Mon Sep 17 00:00:00 2001 From: Nils <> Date: Fri, 15 Apr 2022 00:45:13 +0200 Subject: [PATCH] don't fail when icons are not ready yet --- qtgui/opensessioncontroller.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qtgui/opensessioncontroller.py b/qtgui/opensessioncontroller.py index 49c88a7..84f0d5d 100644 --- a/qtgui/opensessioncontroller.py +++ b/qtgui/opensessioncontroller.py @@ -115,7 +115,10 @@ class ClientItem(QtWidgets.QTreeWidgetItem): def updateIcon(self, clientDict:dict): """Just called during init""" programIcons = self.parentController.mainWindow.programIcons - assert programIcons + if not programIcons: + return #later again. + + assert "executable" in clientDict, clientDict iconColumn = self.parentController.clientsTreeWidgetColumns.index("reportedName") if clientDict["executable"] in programIcons: @@ -422,7 +425,8 @@ class LauncherProgram(QtWidgets.QTreeWidgetItem): self.setText(index, t) programIcons = self.parentController.mainWindow.programIcons - assert programIcons + if not programIcons: + return #later again if launcherDict["agordejoExec"] in programIcons: icon = programIcons[launcherDict["agordejoExec"]] self.setIcon(self.parentController.columns.index("agordejoName"), icon) #name is correct here. this is just the column.