Skip to content
Prev Previous commit
fixup! update code flow while reading
  • Loading branch information
debadree25 committed Feb 19, 2023
commit 002eed44160f431fd4d2b075db96cfea8211d522
7 changes: 4 additions & 3 deletions lib/internal/streams/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,13 @@ module.exports = function compose(...streams) {
while (true) {
try {
const { value, done } = await reader.read();
if (done) {
d.push(null);

if (!d.push(value)) {
return;
}

if (!d.push(value)) {
if (done) {
d.push(null);
return;
}
} catch {
Expand Down