mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
fix exec missing addpayload,
improve switch null test (to include null object) check mqtt has payload before sending
This commit is contained in:
@@ -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"); }
|
||||
|
Reference in New Issue
Block a user