mirror of https://github.com/node-red/node-red.git
Do not crash on malformed json message on websocket.
parent
6bc4b235bb
commit
8506fd0c4b
|
@ -50,7 +50,13 @@ function start() {
|
|||
}
|
||||
});
|
||||
ws.on('message', function(data,flags) {
|
||||
var msg = JSON.parse(data);
|
||||
var msg = null;
|
||||
try {
|
||||
msg = JSON.parse(data);
|
||||
} catch(err) {
|
||||
util.log("[red:comms] received malformed message : "+err.toString());
|
||||
return;
|
||||
}
|
||||
if (msg.subscribe) {
|
||||
handleRemoteSubscription(ws,msg.subscribe);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue