From 97d21e33885774c1b4f3cd9ab864514af54fdaab Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Wed, 15 Oct 2003 04:19:51 +0000 Subject: [PATCH] * src/ListModel.py (find): Prevent traceback if the entry is not found. svn: r2257 --- gramps2/ChangeLog | 3 +++ gramps2/src/ListModel.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 585f29743..ba2be9e4c 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2003-10-14 Alex Roitman + * src/ListModel.py (find): Prevent traceback if the entry is not found. + 2003-10-14 Don Allingham * src/data/templates/Makefile.am: install blue_edge.tpkg * src/docgen/HtmlDoc.py: report error correctly on missing diff --git a/gramps2/src/ListModel.py b/gramps2/src/ListModel.py index f21c8f8dd..2521ac227 100644 --- a/gramps2/src/ListModel.py +++ b/gramps2/src/ListModel.py @@ -247,8 +247,9 @@ class ListModel: return 0 def find(self,info): - iter = self.idmap[info] - self.selection.select_iter(iter) + if info in self.idmap.keys(): + iter = self.idmap[info] + self.selection.select_iter(iter) def cleanup(self): pass