diff --git a/src/VM.ts b/src/VM.ts index b3cf796..fc43bd9 100644 --- a/src/VM.ts +++ b/src/VM.ts @@ -92,8 +92,8 @@ export default class VM { this.#currentChunk = Buffer.alloc(this.#currentChunkSize); data.copy(this.#currentChunk, 0, 4); this.#currentChunkOffset = data.length - 4; - } - if (this.#currentChunkSize > this.#currentChunk!.length) { + if (this.#currentChunkSize > this.#currentChunk!.length) return; + } else if (this.#currentChunkSize > this.#currentChunk!.length) { data.copy(this.#currentChunk!, this.#currentChunkOffset); this.#currentChunkOffset += data.length; return;