From 3f817c3a18eb111bfb3cd88dcc34031c8d0602fc Mon Sep 17 00:00:00 2001 From: poldridge Date: Fri, 6 Jun 2014 22:08:58 -0700 Subject: [PATCH] Update index.js Added missing hasOwnProperty check. socket.io breaks without it when Object.prototype has been extended. --- lib/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 7d67ce92..9e07c304 100644 --- a/lib/index.js +++ b/lib/index.js @@ -159,7 +159,9 @@ Server.prototype.adapter = function(v){ if (!arguments.length) return this._adapter; this._adapter = v; for (var i in this.nsps) { - this.nsps[i].initAdapter(); + if (this.nsps[i].hasOwnProperty(i)) { + this.nsps[i].initAdapter(); + } } return this; };