Skip to content

Commit f72443b

Browse files
committed
Correctly treat handle error in private proxy db (fixes #622)
1 parent 005de6b commit f72443b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

gramps_webapi/api/resources/search.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
from ...const import PRIMARY_GRAMPS_OBJECTS
3737
from ..auth import has_permissions, require_permissions
3838
from ..search import (
39-
get_search_indexer,
40-
get_semantic_search_indexer,
4139
SearchIndexer,
4240
SemanticSearchIndexer,
41+
get_search_indexer,
42+
get_semantic_search_indexer,
4343
)
4444
from ..tasks import (
4545
AsyncResult,
@@ -82,6 +82,8 @@ def get_object_from_handle(
8282
query_method = self.db_handle.method("get_%s_from_handle", class_name)
8383
assert query_method is not None # type checker
8484
obj = query_method(handle)
85+
if obj is None:
86+
raise HandleError(f"Object not found for handle {handle}")
8587
if "profile" in args:
8688
if class_name == "person":
8789
obj.profile = get_person_profile_for_object(

0 commit comments

Comments
 (0)