Skip to content

Commit

Permalink
Check rel type before checking properties (#9)
Browse files Browse the repository at this point in the history
Minor change, but lazy evaluation of the type before checking whether
the properties are there saves me a lot of unnecessary exceptions.
  • Loading branch information
lga-zurich authored Oct 22, 2024
1 parent 6fdfdbe commit ebd1933
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,8 @@ def process_response(
for rel in parsed_json:
# Check if mandatory properties are there
if (
not rel.get("head")
not isinstance(rel, dict)
or not rel.get("head")
or not rel.get("tail")
or not rel.get("relation")
):
Expand Down

0 comments on commit ebd1933

Please sign in to comment.