diff --git a/io/ping/88-ping.js b/io/ping/88-ping.js index e755a5f4..b692d846 100644 --- a/io/ping/88-ping.js +++ b/io/ping/88-ping.js @@ -49,12 +49,13 @@ module.exports = function(RED) { } var msg = { payload:false, topic:node.host }; if (code === 0) { msg = { payload:res, topic:node.host }; } - node.send(msg); + try { node.send(msg); } + catch(e) {} }); }, node.timer); this.on("close", function() { - clearInterval(this.tout); + if (this.tout) { clearInterval(this.tout); } }); } RED.nodes.registerType("ping",PingNode); diff --git a/io/ping/package.json b/io/ping/package.json index a5b8554c..30afad7c 100644 --- a/io/ping/package.json +++ b/io/ping/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-ping", - "version" : "0.0.6", + "version" : "0.0.7", "description" : "A Node-RED node to ping a remote server, for use as a keep-alive check.", "dependencies" : { },