diff --git a/lib/zlib.js b/lib/zlib.js index 029c13a5f47cc6..d5c82f2fbba9ab 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -469,7 +469,9 @@ Zlib.prototype.close = function(callback) { this._closed = true; - this._handle.close(); + if (this._handle) { + this._handle.close(); + } process.nextTick(emitCloseNT, this); };