From a7b8adb0e1bdc450e98dec0e381643b23b21dca5 Mon Sep 17 00:00:00 2001 From: Kazuhiro Ito Date: Fri, 4 Jun 2021 15:08:03 +0900 Subject: [PATCH] Fix allow Flow.getNode to return subflowInstance nodes --- packages/node_modules/@node-red/runtime/lib/flows/Flow.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/runtime/lib/flows/Flow.js b/packages/node_modules/@node-red/runtime/lib/flows/Flow.js index c0eb122c9..95a44e2fb 100644 --- a/packages/node_modules/@node-red/runtime/lib/flows/Flow.js +++ b/packages/node_modules/@node-red/runtime/lib/flows/Flow.js @@ -369,12 +369,12 @@ class Flow { return undefined; } // console.log((new Error().stack).toString().split("\n").slice(1,3).join("\n")) - if ((this.flow.configs && this.flow.configs[id]) || (this.flow.nodes && this.flow.nodes[id])) { + if ((this.flow.configs && this.flow.configs[id]) || (this.flow.nodes && this.flow.nodes[id] && this.flow.nodes[id].type.substring(0,8) != "subflow:")) { // This is a node owned by this flow, so return whatever we have got // During a stop/restart, activeNodes could be null for this id return this.activeNodes[id]; } else if (this.activeNodes[id]) { - // TEMP: this is a subflow internal node within this flow + // TEMP: this is a subflow internal node within this flow or subflow instance node return this.activeNodes[id]; } else if (this.subflowInstanceNodes[id]) { return this.subflowInstanceNodes[id];