delete upon failing to decode JSON from sd blob
This commit is contained in:
parent
edb5083a5e
commit
fcdd9295b4
1 changed files with 1 additions and 0 deletions
|
@ -134,6 +134,7 @@ class StreamDescriptor:
|
|||
try:
|
||||
decoded = json.loads(json_bytes.decode())
|
||||
except json.JSONDecodeError:
|
||||
blob.delete()
|
||||
raise InvalidStreamDescriptorError("Does not decode as valid JSON")
|
||||
if decoded['blobs'][-1]['length'] != 0:
|
||||
raise InvalidStreamDescriptorError("Does not end with a zero-length blob.")
|
||||
|
|
Loading…
Reference in a new issue