diff --git a/package.json b/package.json index af733cd..10d4a5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "armarius", - "version": "1.4.2", + "version": "1.4.3", "description": "A JavaScript library to read, write, and merge ZIP archives in web browsers.", "repository": "github:aternosorg/armarius", "type": "module", diff --git a/src/Archive/Entry/ArchiveEntry.js b/src/Archive/Entry/ArchiveEntry.js index 3b7fd1d..30a77f6 100644 --- a/src/Archive/Entry/ArchiveEntry.js +++ b/src/Archive/Entry/ArchiveEntry.js @@ -230,8 +230,9 @@ export default class ArchiveEntry { let res = new Uint8Array(Number(this.getUncompressedSize())); let offset = 0; let reader = await this.getDataReader(); - while (!reader.eof) { - let chunk = await reader.read(chunkSize); + + let chunk; + while ((chunk = await reader.read(chunkSize)) !== null) { res.set(chunk, offset); offset += chunk.byteLength; }