From 1b884b129d18386a6a16d6d247781f011e80844c Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sat, 21 Aug 2010 20:18:42 +0000 Subject: [PATCH] Protection from a bad child drop svn: r15785 --- src/gui/editors/displaytabs/childmodel.py | 35 ++++++++++++----------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/gui/editors/displaytabs/childmodel.py b/src/gui/editors/displaytabs/childmodel.py index 0731eb5f0..5521f3553 100644 --- a/src/gui/editors/displaytabs/childmodel.py +++ b/src/gui/editors/displaytabs/childmodel.py @@ -56,23 +56,24 @@ class ChildModel(gtk.ListStore): index = 1 for child_ref in self.get_data(): child = db.get_person_from_handle(child_ref.ref) - self.append(row=[ - index, - child.get_gramps_id(), - name_displayer.display(child), - Utils.gender[child.get_gender()], - str(child_ref.get_father_relation()), - str(child_ref.get_mother_relation()), - self.column_birth_day(child), - self.column_death_day(child), - self.column_birth_place(child), - self.column_death_place(child), - child.get_handle(), - name_displayer.sort_string(child.primary_name), - self.column_birth_sort(child), - self.column_death_sort(child), - ]) - index += 1 + if child: + self.append(row=[ + index, + child.get_gramps_id(), + name_displayer.display(child), + Utils.gender[child.get_gender()], + str(child_ref.get_father_relation()), + str(child_ref.get_mother_relation()), + self.column_birth_day(child), + self.column_death_day(child), + self.column_birth_place(child), + self.column_death_place(child), + child.get_handle(), + name_displayer.sort_string(child.primary_name), + self.column_birth_sort(child), + self.column_death_sort(child), + ]) + index += 1 def get_data(self): return self.family.get_child_ref_list()