Skip to content

Commit

Permalink
wip: fix for nodejs#37224
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Apr 21, 2021
1 parent 8ee5bbe commit efb461d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/internal/stream_base_commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,11 @@ function onStreamRead(arrayBuffer) {
}

if (nread !== UV_EOF) {
// CallJSOnreadMethod expects the return value to be a buffer.
// Ref: https://github.com/nodejs/node/pull/34375
stream.destroy(errnoException(nread, 'read'));
if (!stream.destroyed) {
stream.destroy(errnoException(nread, 'read'));
} else {
stream.emit('error', errnoException(nread, 'read'));
}
return;
}

Expand Down

0 comments on commit efb461d

Please sign in to comment.