Skip to content

Commit ae42ca9

Browse files
authored
fix: handle null values when deserializing byte arrays (#991)
1 parent e4f79d5 commit ae42ca9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/encoding/schema/bytearray.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ export class ByteArraySchema extends Schema {
4848
}
4949

5050
public fromPreparedJSON(encoded: JSONEncodingData): Uint8Array {
51+
if (encoded === null || encoded === undefined) {
52+
return this.defaultValue();
53+
}
5154
if (typeof encoded === 'string') {
5255
return base64ToBytes(encoded);
5356
}

0 commit comments

Comments
 (0)