Add an IsOk() check

This commit is contained in:
cncfanatics
2010-08-25 19:28:05 +02:00
parent 321188e23e
commit 05e1deb193

View File

@@ -284,11 +284,12 @@ class ShipBrowser(wx.Panel):
def getSelectedFitID(self):
tree = self.getActiveTree()
selection = tree.GetSelection()
data = tree.GetPyData(selection)
if data is not None:
type, fitID = data
if type == "fit":
return fitID
if selection.IsOk():
data = tree.GetPyData(selection)
if data is not None:
type, fitID = data
if type == "fit":
return fitID
class ShipView(wx.TreeCtrl):