Skip to content

Commit 9f24570

Browse files
nakedibleMylesBorins
authored andcommitted
lib: fix zlib async callback after close
Closing a zlib stream may throw an uncaught exception afterwards if there was a pending callback still to be invoked. This adds a very minimal fix to the issue as all of this code has been rewritten in later versions. Fixes: #15625 PR-URL: #16312 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent d9f4b0f commit 9f24570

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/zlib.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {
595595
this.callback = null;
596596
}
597597

598-
if (self._hadError)
598+
if (self._hadError || !self._handle)
599599
return;
600600

601601
var have = availOutBefore - availOutAfter;

0 commit comments

Comments
 (0)