From 05e1deb193f09fbf6e31af9765f6491add518dea Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Wed, 25 Aug 2010 19:28:05 +0200 Subject: [PATCH] Add an IsOk() check --- gui/shipBrowser.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gui/shipBrowser.py b/gui/shipBrowser.py index 3d267e433..deb67b191 100644 --- a/gui/shipBrowser.py +++ b/gui/shipBrowser.py @@ -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):