diff --git a/gramps/gen/db/generic.py b/gramps/gen/db/generic.py index 916c7ae19..bd2ffe634 100644 --- a/gramps/gen/db/generic.py +++ b/gramps/gen/db/generic.py @@ -1922,9 +1922,8 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback): def iter_sources(self, order_by=None): return self.iter_items(order_by, Source) - def iter_tags(self): - return (Tag.create(data[1]) for data in self.get_tag_cursor()) - + def iter_tags(self, order_by=None): + return self.iter_items(order_by, Tag) def set_prefixes(self, person, media, family, source, citation, place, event, repository, note): diff --git a/gramps/gen/plug/report/utils.py b/gramps/gen/plug/report/utils.py index 39507aeb2..3a14a4668 100644 --- a/gramps/gen/plug/report/utils.py +++ b/gramps/gen/plug/report/utils.py @@ -161,10 +161,12 @@ def insert_image(database, doc, photo, user, # #------------------------------------------------------------------------- def find_spouse(person, family): - if person.get_handle() == family.get_father_handle(): - spouse_handle = family.get_mother_handle() - else: - spouse_handle = family.get_father_handle() + spouse_handle = None + if family: + if person.get_handle() == family.get_father_handle(): + spouse_handle = family.get_mother_handle() + else: + spouse_handle = family.get_father_handle() return spouse_handle #------------------------------------------------------------------------- diff --git a/gramps/gen/utils/db.py b/gramps/gen/utils/db.py index 217e4ded6..ce8410d77 100644 --- a/gramps/gen/utils/db.py +++ b/gramps/gen/utils/db.py @@ -393,8 +393,9 @@ def find_children(db,p): childlist = [] for family_handle in p.get_family_handle_list(): family = db.get_family_from_handle(family_handle) - for child_ref in family.get_child_ref_list(): - childlist.append(child_ref.ref) + if family: + for child_ref in family.get_child_ref_list(): + childlist.append(child_ref.ref) return childlist #------------------------------------------------------------------------- diff --git a/gramps/gui/editors/displaytabs/personeventembedlist.py b/gramps/gui/editors/displaytabs/personeventembedlist.py index af8a15c2e..69c9b3a20 100644 --- a/gramps/gui/editors/displaytabs/personeventembedlist.py +++ b/gramps/gui/editors/displaytabs/personeventembedlist.py @@ -75,6 +75,8 @@ class PersonEventEmbedList(EventEmbedList): if family_handle_list: for family_handle in family_handle_list: family = self.dbstate.db.get_family_from_handle(family_handle) + if family is None: + continue father_handle = family.get_father_handle() mother_handle = family.get_mother_handle() if self.obj.get_handle() == father_handle: diff --git a/gramps/plugins/gramplet/citations.py b/gramps/plugins/gramplet/citations.py index 3e20bc041..2ea5b3512 100644 --- a/gramps/plugins/gramplet/citations.py +++ b/gramps/plugins/gramplet/citations.py @@ -187,12 +187,13 @@ class Citations(Gramplet, DbGUIElement): return False def check_eventref_citations(self, obj): - for event_ref in obj.get_event_ref_list(): - if self.check_attribute_citations(event_ref): - return True - event = self.dbstate.db.get_event_from_handle(event_ref.ref) - if self.check_event_citations(event): - return True + if obj: + for event_ref in obj.get_event_ref_list(): + if self.check_attribute_citations(event_ref): + return True + event = self.dbstate.db.get_event_from_handle(event_ref.ref) + if self.check_event_citations(event): + return True return False def check_event_citations(self, event): diff --git a/gramps/plugins/gramplet/events.py b/gramps/plugins/gramplet/events.py index de24e90fa..4a9ec8ce0 100644 --- a/gramps/plugins/gramplet/events.py +++ b/gramps/plugins/gramplet/events.py @@ -212,9 +212,9 @@ class PersonEvents(Events): spouse = self.dbstate.db.get_person_from_handle(spouse_handle) else: spouse = None - - for event_ref in family.get_event_ref_list(): - self.add_event_ref(event_ref, spouse) + if family: + for event_ref in family.get_event_ref_list(): + self.add_event_ref(event_ref, spouse) def get_start_date(self): """