Skip to content

Commit 777ba69

Browse files
committed
Ensure context menus can be called on items w/o market group
1 parent 9a3bde8 commit 777ba69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gui/builtinContextMenus/cargoAddAmmo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def display(self, callingWindow, srcContext, mainItem):
2525
return True
2626

2727
def getText(self, callingWindow, itmContext, mainItem):
28-
if mainItem.marketGroup.name == "Scan Probes":
28+
if mainItem.marketGroup and mainItem.marketGroup.name == "Scan Probes":
2929
return _t("Add {0} to Cargo (x8)").format(itmContext)
3030

3131
return _t("Add {0} to Cargo (x1000)").format(itmContext)
@@ -34,7 +34,7 @@ def activate(self, callingWindow, fullContext, mainItem, i):
3434
fitID = self.mainFrame.getActiveFit()
3535
typeID = int(mainItem.ID)
3636

37-
if mainItem.marketGroup.name == "Scan Probes":
37+
if mainItem.marketGroup and mainItem.marketGroup.name == "Scan Probes":
3838
command = cmd.GuiAddCargoCommand(fitID=fitID, itemID=typeID, amount=8)
3939
else:
4040
command = cmd.GuiAddCargoCommand(fitID=fitID, itemID=typeID, amount=1000)

0 commit comments

Comments
 (0)