diff --git a/nodes/core/core/75-exec.js b/nodes/core/core/75-exec.js index 5eecbfa88..43aa1c387 100644 --- a/nodes/core/core/75-exec.js +++ b/nodes/core/core/75-exec.js @@ -23,6 +23,7 @@ module.exports = function(RED) { function ExecNode(n) { RED.nodes.createNode(this,n); this.cmd = (n.command || "").trim(); + if (n.addpay == undefined) { n.addpay = true; } this.addpay = n.addpay; this.append = (n.append || "").trim(); this.useSpawn = n.useSpawn; diff --git a/nodes/core/io/10-mqtt.js b/nodes/core/io/10-mqtt.js index 6652ecd57..2d9b45c17 100644 --- a/nodes/core/io/10-mqtt.js +++ b/nodes/core/io/10-mqtt.js @@ -106,7 +106,7 @@ module.exports = function(RED) { if (node.topic) { msg.topic = node.topic; } - if ((msg.hasOwnProperty("topic")) && (typeof msg.topic === "string") && (msg.topic !== "")) { // topic must exist + if (msg.hasOwnProperty("payload") && (msg.hasOwnProperty("topic")) && (typeof msg.topic === "string") && (msg.topic !== "")) { // topic must exist this.client.publish(msg); // send the message } else { node.warn("Invalid topic specified"); } diff --git a/nodes/core/logic/10-switch.js b/nodes/core/logic/10-switch.js index 0cd1dc626..420008b6b 100644 --- a/nodes/core/logic/10-switch.js +++ b/nodes/core/logic/10-switch.js @@ -28,8 +28,8 @@ module.exports = function(RED) { 'regex': function(a, b) { return (a + "").match(new RegExp(b)); }, 'true': function(a) { return a === true; }, 'false': function(a) { return a === false; }, - 'null': function(a) { return typeof a == "undefined"; }, - 'nnull': function(a) { return typeof a != "undefined"; }, + 'null': function(a) { return (typeof a == "undefined" || a === null); }, + 'nnull': function(a) { return (typeof a != "undefined" && a !== null); }, 'else': function(a) { return a === true; } };