Skip to content

Commit f26e6e8

Browse files
committed
Fix issue with link to private object
1 parent 434f606 commit f26e6e8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gramps_webapi/api/html.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,11 @@ def build_link(prop: str, handle: str, obj_class: str) -> str:
113113
ref = handle
114114
func = db_handle.method("get_%s_from_handle", obj_class)
115115
obj = func(ref)
116+
if obj is None:
117+
return ""
116118
gramps_id = obj.gramps_id
117119
else:
118-
raise ValueError("Unexpected property: {}".format(prop))
120+
raise ValueError(f"Unexpected property: {prop}")
119121
return link_format.format(
120122
obj_class=obj_class.lower(), gramps_id=gramps_id, handle=ref
121123
)

0 commit comments

Comments
 (0)