diff --git a/lib/internal/streams/end-of-stream.js b/lib/internal/streams/end-of-stream.js index f3aecd8f2aa8d4..aad43823f9afb9 100644 --- a/lib/internal/streams/end-of-stream.js +++ b/lib/internal/streams/end-of-stream.js @@ -87,7 +87,6 @@ function eos(stream, opts, callback) { }; const onclose = () => { - let err; if (readable && !readableEnded) { if (!isReadableEnded(stream)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE()); @@ -96,7 +95,7 @@ function eos(stream, opts, callback) { if (!isWritableFinished(stream)) return callback.call(stream, new ERR_STREAM_PREMATURE_CLOSE()); } - callback.call(stream, err); + callback.call(stream); }; const onrequest = () => {