Skip to content

Commit c7074f4

Browse files
committed
Add a guard against situation where fit is empty for some reason
1 parent f6f3a69 commit c7074f4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

gui/builtinContextMenus/fitAddCurrentlyOpen.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ def getSubMenu(self, callingWindow, context, rootMenu, i, pitem):
4747
if isinstance(page, BlankPage):
4848
continue
4949
fit = sFit.getFit(page.activeFitID, basic=True)
50+
if fit is None:
51+
continue
5052
id = ContextMenuUnconditional.nextID()
5153
mitem = wx.MenuItem(rootMenu, id, "{}: {}".format(fit.ship.item.name, fit.name))
5254
bindmenu.Bind(wx.EVT_MENU, self.handleSelection, mitem)

0 commit comments

Comments
 (0)