diff --git a/lib/net.js b/lib/net.js index 10c76fff8e..e0bbef64e8 100644 --- a/lib/net.js +++ b/lib/net.js @@ -191,7 +191,7 @@ function onSocketFinish() { debug('oSF: not ended, call shutdown()'); // otherwise, just shutdown, or destroy() if not possible - if (!this._handle.shutdown) + if (!this._handle || !this._handle.shutdown) return this.destroy(); var shutdownReq = this._handle.shutdown();