Check for type and data not being undefined
This commit is contained in:
parent
cfcf815275
commit
4f9f206b42
1 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue