diff options
Diffstat (limited to 'gn3/db')
-rw-r--r-- | gn3/db/rdf/wiki.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gn3/db/rdf/wiki.py b/gn3/db/rdf/wiki.py index 03945ec..7d0b3f3 100644 --- a/gn3/db/rdf/wiki.py +++ b/gn3/db/rdf/wiki.py @@ -31,8 +31,10 @@ WIKI_CONTEXT = BASE_CONTEXT | { } -def __sanitize_result(result: dict): +def __sanitize_result(result: dict) -> dict: """Make sure `categories` and `pubmed_ids` are always arrays""" + if not result: + return {} categories = result.get("categories") if isinstance(categories, str): result["categories"] = [categories] if categories else [] |