Skip to content

Commit

Permalink
Prevent End-Of-Stream error in stream()
Browse files Browse the repository at this point in the history
Suppress the End-Of-Stream, instead assign `undefined` to `stream.fileType`.

Fix: #467
  • Loading branch information
Borewit committed Jul 20, 2021
1 parent 9102f1c commit e4b6228
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,11 @@ const stream = readableStream => new Promise((resolve, reject) => {
pass.fileType = fileType;
} catch (error) {
reject(error);
if (error instanceof strtok3.EndOfStreamError) {
pass.fileType = undefined;
} else {
reject(error);
}
}

resolve(outputStream);
Expand Down

0 comments on commit e4b6228

Please sign in to comment.