Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Jun 11, 2021
1 parent 0ba9820 commit 1b18705
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/internal/streams/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,12 @@ async function pump(iterable, writable, finish) {
};

const waitForDrain = () => new Promise((resolve) => {
if (error || writable.destroyed) return resolve();
assert.strictEqual(callback, noop);
callback = resolve;
if (error || writable.destroyed) {
resolve();
} else {
callback = resolve;
}
})

writable
Expand Down

0 comments on commit 1b18705

Please sign in to comment.