diff --git a/dao/socketServer.js b/dao/socketServer.js index 4e01e52..0296196 100644 --- a/dao/socketServer.js +++ b/dao/socketServer.js @@ -176,18 +176,13 @@ function gotData(socket,data,UDPSocket){ let message=new Message; message.load(data.shift()); - // In case either `type` or `data` is missing we won't process this message. - if (message.type === undefined || message.data === undefined) { - this.log('Message is missing either `type` or `data` property, skipping message.'); - continue; + // Only set the sock id if it is specified. + if (message.data && message.data.id){ + sock.id=message.data.id; } this.log('received event of : ',message.type,message.data); - if(message.data.id){ - sock.id=message.data.id; - } - this.publish( message.type, message.data,