From 633afbbb4428c6c0bfbb3de1cf0d42e8e1adc534 Mon Sep 17 00:00:00 2001 From: Franck Mourre Date: Mon, 11 Jul 2022 10:51:31 +0200 Subject: [PATCH] Fix change node, not handling from field properly when using context --- .../node_modules/@node-red/nodes/core/function/15-change.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/nodes/core/function/15-change.js b/packages/node_modules/@node-red/nodes/core/function/15-change.js index d177caec8..94f47fcbf 100644 --- a/packages/node_modules/@node-red/nodes/core/function/15-change.js +++ b/packages/node_modules/@node-red/nodes/core/function/15-change.js @@ -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) {