Fix change node, not handling from field properly when using context

This commit is contained in:
Franck Mourre 2022-07-11 10:51:31 +02:00
parent e14dd06a94
commit 7a048d5b32
1 changed files with 2 additions and 2 deletions

View File

@ -168,9 +168,9 @@ module.exports = function(RED) {
return getFromValueType(RED.util.getMessageProperty(msg,rule.from),done);
} else if (rule.fromt === 'flow' || rule.fromt === 'global') {
var contextKey = RED.util.parseContextStore(rule.from);
if (/\[msg\./.test(context.key)) {
if (/\[msg\./.test(contextKey.key)) {
// The key has a nest msg. reference to evaluate first
context.key = RED.util.normalisePropertyExpression(contextKey.key,msg,true);
contextKey.key = RED.util.normalisePropertyExpression(contextKey.key,msg,true);
}
node.context()[rule.fromt].get(contextKey.key, contextKey.store, (err,fromValue) => {
if (err) {