You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug] decode throws RangeError on empty Uint8Array #198
Uncaught RangeError: OffsetisoutsidetheboundsoftheDataViewatDataView.getUint8(<anonymous>)
at Decoder.readU8 (/home/kuba/tmp_/node_modules/@msgpack/msgpack/dist/Decoder.js:532:33)
at Decoder.readHeadByte (/home/kuba/tmp_/node_modules/@msgpack/msgpack/dist/Decoder.js:425:34)
at Decoder.doDecodeSync (/home/kuba/tmp_/node_modules/@msgpack/msgpack/dist/Decoder.js:169:35)
at Decoder.decode (/home/kuba/tmp_/node_modules/@msgpack/msgpack/dist/Decoder.js:89:29)
at decode (/home/kuba/tmp_/node_modules/@msgpack/msgpack/dist/decode.js:14:20)
Activity
mrl5 commentedon Jan 19, 2022
workaround is to check if
length > 0and thendecode()gfx commentedon May 1, 2022
This is an expected behavior, as
JSON.parse("")raises a SyntaxError.I've clarified the behavior in #209 by adding test cases to make sure this behavior.
Handle edge case where message has length zero