From cd6a2b70c4e36eac69e009728776fc05c1c4f78d Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Wed, 27 Mar 2013 13:47:04 +0000 Subject: [PATCH] 6470: Crash by filtering with filter bar in person tree view svn: r21759 --- gramps/gui/views/treemodels/treebasemodel.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gramps/gui/views/treemodels/treebasemodel.py b/gramps/gui/views/treemodels/treebasemodel.py index 95d28a3f3..79ef467f5 100644 --- a/gramps/gui/views/treemodels/treebasemodel.py +++ b/gramps/gui/views/treemodels/treebasemodel.py @@ -828,6 +828,8 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel): :param path: node as it appears in the treeview :type path: Node """ + if node is None: + raise Exception, 'Not allowed to add None as node' iter = self._new_iter(id(node)) return iter @@ -839,9 +841,13 @@ class TreeBaseModel(GObject.Object, Gtk.TreeModel): def get_iter_from_handle(self, handle): """ - Get the iter for a gramps handle. + Get the iter for a gramps handle. Should return None if iter not + visible """ - return self._get_iter(self._get_node(handle)) + node = self._get_node(handle) + if node is None: + return None + return self._get_iter(node) def get_handle_from_iter(self, iter): """