Comparing version 0.2.3 to 0.2.4
{ | ||
"name": "koa-ws", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"keywords": [ | ||
@@ -10,3 +10,3 @@ "koa", | ||
], | ||
"description": "integrates ws with koa, featuring shared sessions and json-rpc 2.0 protocol", | ||
"description": "Integrates ws with koa, featuring shared sessions and json-rpc 2.0 protocol", | ||
"author": "Marcus Ekwall <marcus.ekwall@gmail.com>", | ||
@@ -34,3 +34,3 @@ "license": "ISC", | ||
"object-assign": "^0.3.1", | ||
"replacestream": "^0.1.3", | ||
"replacestream": "^0.1.4", | ||
"ws": "^0.4.32" | ||
@@ -37,0 +37,0 @@ }, |
@@ -202,9 +202,11 @@ var co = require('co'); | ||
KoaWebSocketServer.prototype.broadcast = function (method, params) { | ||
for (var i in this.server.clients) { | ||
this.server.clients[i].method(method, params, function (err) { | ||
debug('Could not send message', data, err); | ||
}); | ||
if(this.server && this.server.clients) { | ||
for (var i in this.server.clients) { | ||
this.server.clients[i].method(method, params, function (err) { | ||
debug('Could not send message', data, err); | ||
}); | ||
} | ||
} | ||
} | ||
module.exports = KoaWebSocketServer; | ||
module.exports = KoaWebSocketServer; |
28783
660
Updatedreplacestream@^0.1.4