Skip to content

Commit 62d1d6a

Browse files
committed
Avoid crash when nothing is selected
1 parent 83fa567 commit 62d1d6a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

gui/characterEditor.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ def SaveCharacterAs(parent, charID):
312312

313313

314314
class SkillTreeView(wx.Panel):
315+
315316
def __init__(self, parent):
316317
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize,
317318
style=wx.TAB_TRAVERSAL)
@@ -611,12 +612,16 @@ def expandLookup(self, event):
611612

612613
def spawnMenu(self, event):
613614
item = event.GetItem()
615+
itemData = self.skillTreeListCtrl.GetItemData(item)
616+
if itemData is None:
617+
return
618+
614619
self.skillTreeListCtrl.Select(item)
615620
thing = self.skillTreeListCtrl.GetFirstChild(item).IsOk()
616621
if thing:
617622
return
618623

619-
id = self.skillTreeListCtrl.GetItemData(item)[1]
624+
id = itemData[1]
620625
eveItem = Market.getInstance().getItem(id)
621626

622627
srcContext = "skillItem"

0 commit comments

Comments
 (0)