mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 10:11:05 -03:30
Allow parsing null JSON data
This commit is contained in:
@@ -57,8 +57,10 @@ class JSONParser(parsers.JSONParser):
|
||||
|
||||
try:
|
||||
data = stream.read().decode(encoding)
|
||||
if not data:
|
||||
return {}
|
||||
obj = json.loads(data, object_pairs_hook=OrderedDict)
|
||||
if not isinstance(obj, dict):
|
||||
if not isinstance(obj, dict) and obj is not None:
|
||||
raise ParseError(_('JSON parse error - not a JSON object'))
|
||||
return obj
|
||||
except ValueError as exc:
|
||||
|
||||
Reference in New Issue
Block a user