1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Use RED.util.getMessageProperty() to check message property

This commit is contained in:
Kazuhito Yokoi 2021-03-22 20:48:01 +09:00
parent cb72d5100e
commit 89485971fa

View File

@ -66,8 +66,9 @@ module.exports = function(RED) {
// then prepend with the msg.payload
var arg = node.cmd;
if (node.addpay) {
if (msg.hasOwnProperty(node.addpayValue)) {
arg += " " + RED.util.getMessageProperty(msg, node.addpayValue);
var value = RED.util.getMessageProperty(msg, node.addpayValue);
if (value !== undefined) {
arg += " " + value;
}
}
if (node.append.trim() !== "") { arg += " " + node.append; }