Skip to content

Commit

Permalink
catch when JSON data is not decoded, e.g. broken syntax (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
albertmink authored Mar 10, 2022
1 parent 2406e9a commit 6994c9a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions json-validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def match_schema_instance( ):
version = json_data["formatVersion"]
except KeyError:
continue
except TypeError:
# in case decoding failed
continue
# match data with schema
schema_name = object_type + '-v'+ version + '.json'
schema = [s for s in schemas if schema_name in s]
Expand Down

0 comments on commit 6994c9a

Please sign in to comment.