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

Merge pull request #4215 from node-red/4213-fix-subflow-env

Fix subflow env var `length` not correctly handled in Node-RED
This commit is contained in:
Nick O'Leary 2023-06-21 14:06:05 +01:00 committed by GitHub
commit 234e92db12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -808,7 +808,7 @@ function handlePreRoute(flow, sendEvent, reportError) {
return;
} else if (err !== false) {
sendEvent.destination.node = flow.getNode(sendEvent.destination.id);
if (sendEvent.destination.node) {
if (sendEvent.destination.node && typeof sendEvent.destination.node === 'object') {
if (sendEvent.cloneMessage) {
sendEvent.msg = redUtil.cloneMessage(sendEvent.msg);
}

View File

@ -119,7 +119,7 @@ class Subflow extends Flow {
this.templateCredentials = credentials.get(subflowDef.id) || {};
this.instanceCredentials = credentials.get(id) || {};
var env = [];
var env = {};
if (this.subflowDef.env) {
this.subflowDef.env.forEach(e => {
env[e.name] = e;