diff --git a/lib/zlib.js b/lib/zlib.js index 8a81856949b18c..7440280c1b5420 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -136,7 +136,6 @@ function zlibBufferOnError(err) { function zlibBufferOnEnd() { let buf; - let err; if (this.nread === 0) { buf = Buffer.alloc(0); } else { @@ -144,9 +143,7 @@ function zlibBufferOnEnd() { buf = (bufs.length === 1 ? bufs[0] : Buffer.concat(bufs, this.nread)); } this.close(); - if (err) - this.cb(err); - else if (this._info) + if (this._info) this.cb(null, { buffer: buf, engine: this }); else this.cb(null, buf);