Skip to content

Commit

Permalink
8768: Gramps throws fatal error when trying to delete a family
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Blank committed Aug 1, 2015
1 parent e7ce80a commit de6847d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions gramps/gen/utils/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,13 @@ def get_event_ref(db, family, event_type):
Return a reference to a primary family event of the given event type.
"""
from ..lib.eventroletype import EventRoleType
for event_ref in family.get_event_ref_list():
event = db.get_event_from_handle(event_ref.ref)
if (event and event.get_type() == event_type and
(event_ref.get_role() == EventRoleType.FAMILY or
event_ref.get_role() == EventRoleType.PRIMARY)):
return event_ref
if family:
for event_ref in family.get_event_ref_list():
event = db.get_event_from_handle(event_ref.ref)
if (event and event.get_type() == event_type and
(event_ref.get_role() == EventRoleType.FAMILY or
event_ref.get_role() == EventRoleType.PRIMARY)):
return event_ref
return None

def get_primary_event_ref_list(db, family):
Expand Down

0 comments on commit de6847d

Please sign in to comment.