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()