mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Do not crash on malformed json message on websocket.
This commit is contained in:
		| @@ -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); | ||||
|             } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user