Skip to content

Commit a390a32

Browse files
committed
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
1 parent 8b70ad1 commit a390a32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/zlib.js

+1-1
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)