Skip to content

Commit

Permalink
provides fix for RangeError
Browse files Browse the repository at this point in the history
  • Loading branch information
NetOpWibby committed Oct 3, 2023
1 parent b5fc265 commit 99c035c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export class DEFAULT {
encodeBytes = 0;

decode(buf, offset?) {
if (!offset)
/// catch range errors
if (!offset || offset < 0 || offset > 12)
offset = 0;

const answer = new Answer();
Expand Down

0 comments on commit 99c035c

Please sign in to comment.