From 6223685b3418f7e483d0c7730e0e85d5c6b633bc Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 25 Aug 2004 03:37:48 +0000 Subject: [PATCH] * src/DisplayModels.py: handle a closed database in on_get_value * src/PeopleModel.py: handle a closed database in on_get_value svn: r3509 --- gramps2/ChangeLog | 2 ++ gramps2/src/DisplayModels.py | 5 ++++- gramps2/src/PeopleModel.py | 6 ++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 2b032df41..d3090e8c2 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -2,6 +2,8 @@ * src/ReadXML.py: Fix file copy problem, handle copy failure * src/ImageSelect.py: Display GRAMPS ID, not DB handle * src/WriteGedcom.py: handle image file problems when exporting + * src/DisplayModels.py: handle a closed database in on_get_value + * src/PeopleModel.py: handle a closed database in on_get_value 2004-08-24 Martin Hawlisch * src/plugins/WebPage.py: web page enhancements, including diff --git a/gramps2/src/DisplayModels.py b/gramps2/src/DisplayModels.py index fd746e5f6..a8d626ef1 100644 --- a/gramps2/src/DisplayModels.py +++ b/gramps2/src/DisplayModels.py @@ -81,7 +81,10 @@ class BaseModel(gtk.GenericTreeModel): return None def on_get_value(self,iter,col): - return self.fmap[col](self.map[str(iter)]) + try: + return self.fmap[col](self.map[str(iter)]) + except: + return u'' def on_iter_next(self, node): '''returns the next node at this level of the tree''' diff --git a/gramps2/src/PeopleModel.py b/gramps2/src/PeopleModel.py index 7f3553aa7..5fe576490 100644 --- a/gramps2/src/PeopleModel.py +++ b/gramps2/src/PeopleModel.py @@ -204,8 +204,10 @@ class PeopleModel(gtk.GenericTreeModel): else: return u'' else: - val = self.fmap[col](self.db.person_map[str(iter)]) - return val + try: + return self.fmap[col](self.db.person_map[str(iter)]) + except: + return u'' def reset_visible(self): self.visible = {}