]> git.saurik.com Git - wxWidgets.git/commitdiff
Ensure the old tree item still exists before using it
authorRobin Dunn <robin@alldunn.com>
Tue, 21 Nov 2006 03:50:44 +0000 (03:50 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 21 Nov 2006 03:50:44 +0000 (03:50 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43557 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/wx/tools/XRCed/tree.py

index 3fb095bcec2d2ca3ac9e1b2881a12deec6a6b71f..26e8b91a8a9a0fb6a5e3439a76c016462ab81b6d 100644 (file)
@@ -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():