From e574f4516fd9599bf0cda6fbd8e29693c605a103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathana=C3=ABl=20L=C3=A9caud=C3=A9?= Date: Tue, 18 Apr 2017 11:03:16 -0400 Subject: [PATCH] Update 31-tcpin.js (#1235) TCP-IN: Add check to see if object exists, fixes issue #1222 --- nodes/core/io/31-tcpin.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nodes/core/io/31-tcpin.js b/nodes/core/io/31-tcpin.js index 4a9650802..776ce942a 100644 --- a/nodes/core/io/31-tcpin.js +++ b/nodes/core/io/31-tcpin.js @@ -461,8 +461,10 @@ module.exports = function(RED) { } } else if (node.splitc === 0) { - clients[connection_id].msg.payload = data; - node.send(clients[connection_id].msg); + if (clients[connection_id]) { + clients[connection_id].msg.payload = data; + node.send(clients[connection_id].msg); + } } else { for (var j = 0; j < data.length; j++ ) {