Skip to content

Commit

Permalink
correctly detect eof in Entry.getData
Browse files Browse the repository at this point in the history
  • Loading branch information
KurtThiemann committed Jul 7, 2022
1 parent 879636a commit 2b75800
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 3 additions & 2 deletions src/Archive/Entry/ArchiveEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2b75800

Please sign in to comment.