Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup
  • Loading branch information
ronag committed Jun 12, 2021
commit c23ab6439bca2cf79b0dfbf8e1deb00e45da29ec
13 changes: 11 additions & 2 deletions lib/internal/streams/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,24 @@ async function pump(iterable, writable, finish) {
await waitForDrain();
}

if (error) {
return;
}

for await (const chunk of iterable) {
if (!writable.write(chunk)) {
await waitForDrain();
}
if (error) {
return;
}
}

if (!error) {
writable.end();
if (error) {
return;
}

writable.end();
} catch (err) {
error = aggregateTwoErrors(error, err);
} finally {
Expand Down