diff options
author | Matteo Collina <hello@matteocollina.com> | 2018-10-26 12:38:08 +0200 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2018-10-28 15:02:10 +0100 |
commit | b1e1fe4e07e24fcafa278b498291620dd61411ab (patch) | |
tree | 24c2499fb5b0129839c2c188c5fcab8f39f3236b /lib/internal/streams/async_iterator.js | |
parent | 398418dd2619a2853b4a8b252db90fdf4cb60f7c (diff) | |
download | android-node-v8-b1e1fe4e07e24fcafa278b498291620dd61411ab.tar.gz android-node-v8-b1e1fe4e07e24fcafa278b498291620dd61411ab.tar.bz2 android-node-v8-b1e1fe4e07e24fcafa278b498291620dd61411ab.zip |
stream: do not error async iterators on destroy(null)
Fixes: https://github.com/nodejs/node/issues/23890
PR-URL: https://github.com/nodejs/node/pull/23901
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/internal/streams/async_iterator.js')
-rw-r--r-- | lib/internal/streams/async_iterator.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/internal/streams/async_iterator.js b/lib/internal/streams/async_iterator.js index 5d7f3f0fb4..90960f5a38 100644 --- a/lib/internal/streams/async_iterator.js +++ b/lib/internal/streams/async_iterator.js @@ -153,7 +153,7 @@ const createReadableStreamAsyncIterator = (stream) => { }); finished(stream, (err) => { - if (err) { + if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { const reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise // returned by next() and store the error |