From 8cc81cebdd8b8cf56aa715e6b244f4e20f11ea15 Mon Sep 17 00:00:00 2001 From: burnsypet Date: Sat, 19 Aug 2017 18:47:58 +0100 Subject: [PATCH] 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. --- gui/characterEditor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gui/characterEditor.py b/gui/characterEditor.py index 90f955fcb4..e8b351f830 100644 --- a/gui/characterEditor.py +++ b/gui/characterEditor.py @@ -659,7 +659,11 @@ def spawnMenu(self): # 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()