Skip to content

Commit

Permalink
Prevent End-Of-Stream error in stream() (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
Borewit committed Jul 22, 2021
1 parent 9102f1c commit 67c8fcb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion core.js
Expand Up @@ -1436,7 +1436,11 @@ const stream = readableStream => new Promise((resolve, reject) => {
const fileType = await fromBuffer(chunk);
pass.fileType = fileType;
} catch (error) {
reject(error);
if (error instanceof strtok3.EndOfStreamError) {
pass.fileType = undefined;
} else {
reject(error);
}
}

resolve(outputStream);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -197,7 +197,7 @@
},
"dependencies": {
"readable-web-to-node-stream": "^3.0.0",
"strtok3": "^6.1.1",
"strtok3": "~6.1.3",
"token-types": "^3.0.0"
},
"xo": {
Expand Down

0 comments on commit 67c8fcb

Please sign in to comment.