From: Robin Dunn Date: Tue, 21 Nov 2006 03:50:44 +0000 (+0000) Subject: Ensure the old tree item still exists before using it X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/13542f4946e681db5bd765e8bad6402a12adfd1f Ensure the old tree item still exists before using it git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43557 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/wx/tools/XRCed/tree.py b/wxPython/wx/tools/XRCed/tree.py index 3fb095bcec..26e8b91a8a 100644 --- a/wxPython/wx/tools/XRCed/tree.py +++ b/wxPython/wx/tools/XRCed/tree.py @@ -692,7 +692,8 @@ class XML_Tree(wx.TreeCtrl): #oldItem = evt.GetOldItem() status = '' oldItem = self.selection - if oldItem: + # use GetItemParent as a way to determine if the itemId is still valid + if oldItem and self.GetItemParent(oldItem): xxx = self.GetPyData(oldItem) # If some data was modified, apply changes if g.panel.IsModified():