Check for type and data not being undefined

This commit is contained in:
Melvin Valster 2017-01-24 11:22:53 +01:00
parent cfcf815275
commit 4f9f206b42

View file

@ -177,7 +177,8 @@ function gotData(socket,data,UDPSocket){
message.load(data.shift()); message.load(data.shift());
// In case either `type` or `data` is missing we won't process this message. // In case either `type` or `data` is missing we won't process this message.
if (!message.type || !message.data) { if (message.type === undefined || message.data === undefined) {
this.log('Message is missing either `type` or `data` property, skipping message.');
continue; continue;
} }