From 1f12cdd6802bb24899fd03e4b0e751e456ac2631 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 --- ChangeLog | 2 ++ src/DisplayModels.py | 5 ++++- src/PeopleModel.py | 6 ++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b032df41..d3090e8c2 100644 --- a/ChangeLog +++ b/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/src/DisplayModels.py b/src/DisplayModels.py index fd746e5f6..a8d626ef1 100644 --- a/src/DisplayModels.py +++ b/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/src/PeopleModel.py b/src/PeopleModel.py index 7f3553aa7..5fe576490 100644 --- a/src/PeopleModel.py +++ b/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 = {}