From c94cc42a84fe83a748c4e8fb7e3faa990cbf6b74 Mon Sep 17 00:00:00 2001 From: Brian White Date: Sun, 19 Jan 2014 02:15:42 -0500 Subject: [PATCH] Connection: add guard in destroy() --- lib/Connection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Connection.js b/lib/Connection.js index 356e085..4671982 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -243,7 +243,7 @@ Connection.prototype.serverSupports = function(cap) { Connection.prototype.destroy = function() { this._queue = []; this._curReq = undefined; - this._sock.destroy(); + this._sock && this._sock.destroy(); }; Connection.prototype.end = function() {