From 74b96aa7742a98df69dabb38a208777614e7ce48 Mon Sep 17 00:00:00 2001 From: Hans Pinckaers Date: Tue, 21 Jun 2011 21:19:48 +0200 Subject: [PATCH] Made the router a little safer. --- node/SocketIORouter.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/node/SocketIORouter.js b/node/SocketIORouter.js index 35eee4b5c..919849994 100644 --- a/node/SocketIORouter.js +++ b/node/SocketIORouter.js @@ -62,8 +62,13 @@ exports.setSocketIO = function(_socket) if(message.component && components[message.component]) { console.error(message); + + //check if component is registered in the components array + if(components[message.component]) + { + components[message.component].handleMessage(client, message); + } - components[message.component].handleMessage(client, message); } else {