Skip to content

Commit

Permalink
Fix for deleted objects referenced in Note StyledText Links
Browse files Browse the repository at this point in the history
Fixes #10178
  • Loading branch information
prculley authored and Nick-Hall committed Sep 1, 2017
1 parent ac4ba4c commit 86e2d96
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions gramps/gen/simple/_simpleaccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"""
from ..lib import (Person, Family, Event, Source, Place, Citation,
Media, Repository, Note, Date, Tag)
from ..errors import HandleError
from ..datehandler import displayer
from ..utils.string import gender as gender_map
from ..utils.db import get_birth_or_fallback, get_death_or_fallback
Expand Down Expand Up @@ -961,8 +962,12 @@ def display(self, object_class, prop, value):
:param value: gramps_id or handle.
"""
if object_class in self.dbase.get_table_names():
obj = self.dbase.get_table_metadata(object_class)\
[prop + "_func"](value)
try:
obj = self.dbase.get_table_metadata(
object_class)[prop + "_func"](value)
except HandleError:
# Deals with deleted objects referenced in Note Links
obj = None
if obj:
if isinstance(obj, Person):
return "%s: %s [%s]" % (_(object_class),
Expand Down

0 comments on commit 86e2d96

Please sign in to comment.