diff --git a/system/binaryreader.ts b/system/binaryreader.ts index a060dfc..05df620 100644 --- a/system/binaryreader.ts +++ b/system/binaryreader.ts @@ -38,7 +38,7 @@ export class BinaryReader { public read(fmt: string, size: number) { const unpacked = string.unpack(fmt, this.data, this.pos); this.pos += size; - if (unpacked.length <= 0) { + if (typeof unpacked === 'number' || unpacked.length <= 0) { return 0; } return unpacked[0];