Ensure there is a g.testWin before trying to use it

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45701 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2007-04-27 22:13:31 +00:00
parent b4f4d3dd61
commit 09a68e8818

View File

@@ -687,7 +687,7 @@ class Frame(wx.Frame):
if index == 0: return # No previous sibling found
# Remove highlight, update testWin
if g.testWin.highLight:
if g.testWin and g.testWin.highLight:
g.testWin.highLight.Remove()
tree.needUpdate = True
@@ -723,7 +723,7 @@ class Frame(wx.Frame):
if not next: return
# Remove highlight, update testWin
if g.testWin.highLight:
if g.testWin and g.testWin.highLight:
g.testWin.highLight.Remove()
tree.needUpdate = True
@@ -763,7 +763,7 @@ class Frame(wx.Frame):
if not self.ItemsAreCompatible(tree.GetPyData(pparent).treeObject(), tree.GetPyData(selected).treeObject()): return
# Remove highlight, update testWin
if g.testWin.highLight:
if g.testWin and g.testWin.highLight:
g.testWin.highLight.Remove()
tree.needUpdate = True
@@ -830,7 +830,7 @@ class Frame(wx.Frame):
if not self.ItemsAreCompatible(parent, tree.GetPyData(selected).treeObject()): return
# Remove highlight, update testWin
if g.testWin.highLight:
if g.testWin and g.testWin.highLight:
g.testWin.highLight.Remove()
tree.needUpdate = True
@@ -1358,7 +1358,7 @@ Homepage: http://xrced.sourceforge.net\
tree.HighLight(tree.pendingHighLight)
except:
# Remove highlight if any problem
if g.testWin.highLight:
if g.testWin and g.testWin.highLight:
g.testWin.highLight.Remove()
tree.pendingHighLight = None
raise