Don't attempt PopupMenu if getMenu returned False

Change to characterEditor.py:
Added logic to prevent a crash when attempting to execute
self.PopupMenu(menu) when menu was False. This would occur in the
situation where there were no saved implant sets.
This commit is contained in:
burnsypet
2017-08-19 18:47:58 +01:00
parent c33aeb7275
commit 8cc81cebdd

View File

@@ -659,7 +659,11 @@ class ImplantEditorView(BaseImplantEditorView):
# fuck good coding practices, passing a pointer to the character editor here for [reasons] =D
# (see implantSets context class for info)
menu = ContextMenu.getMenu((self.Parent.Parent,), *context)
self.PopupMenu(menu)
if menu:
self.PopupMenu(menu)
else:
pyfalog.debug("ContextMenu.getMenu returned false do not attempt PopupMenu")
def determineEnabled(self):
char = self.Parent.Parent.entityEditor.getActiveEntity()