From 5afb3c0e29468120a8883835d89f32328466371e Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sat, 18 Nov 2006 04:24:04 +0000 Subject: [PATCH] 2006-11-17 Don Allingham * src/ManagedWindow.py: catch missing item error svn: r7642 --- gramps2/ChangeLog | 3 +++ gramps2/src/ManagedWindow.py | 13 ++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 97cf05f52..b0944d627 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2006-11-17 Don Allingham + * src/ManagedWindow.py: catch missing item error + 2006-11-16 Don Allingham * src/DataViews/_RelationView.py: share parents button * src/images/share-fam.png: share parents button diff --git a/gramps2/src/ManagedWindow.py b/gramps2/src/ManagedWindow.py index babd159ad..d2b1bc44c 100644 --- a/gramps2/src/ManagedWindow.py +++ b/gramps2/src/ManagedWindow.py @@ -118,11 +118,14 @@ class GrampsWindowManager: def close_track(self,track): # This is called when item needs to be closed # Closes all its children and then removes the item from the tree. - item = self.get_item_from_track(track) - self.recursive_action(item,self.close_item) - # This only needs to be run once for the highest level point - # to remove. - self.remove_item(track) + try: + item = self.get_item_from_track(track) + self.recursive_action(item,self.close_item) + # This only needs to be run once for the highest level point + # to remove. + self.remove_item(track) + except IndexError: + print "Missing item from window manager", track, self.close_item def recursive_action(self,item,func,*args): # This function recursively calls itself over the child items