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 09dff8f50..1a3edc595 100644 --- a/packages/node_modules/@node-red/runtime/lib/flows/Flow.js +++ b/packages/node_modules/@node-red/runtime/lib/flows/Flow.js @@ -632,7 +632,7 @@ class Flow { } } else { const candidateNodes = []; - const isConfigNode = !!node._flow.flow.configs[node.id]; + const isConfigNode = !!node._flow?.flow.configs[node.id]; this.catchNodes.forEach(targetCatchNode => { if (msg === null && !targetCatchNode.anyError) { // Skip if the catch node only accepts errors produced by message processing diff --git a/test/nodes/core/function/10-function_spec.js b/test/nodes/core/function/10-function_spec.js index ba7c22707..46159d545 100644 --- a/test/nodes/core/function/10-function_spec.js +++ b/test/nodes/core/function/10-function_spec.js @@ -69,8 +69,7 @@ describe('function node', function() { }); it('should do something with the catch node', function(done) { - // TODO: global flow should not contain these nodes - var flow = [{"id":"flow","type":"tab"},{"id":"funcNode","type":"function","wires":[["goodNode"]],"func":"node.error('This is an error', msg);","z":"flow"},{"id":"goodNode","type":"helper","z":"flow"},{"id":"badNode","type":"helper","z":"flow"},{"id":"catchNode","type":"catch","scope":null,"uncaught":false,"wires":[["badNode"]],"anyError":true,"includeConfig":true,"z":"flow"}]; + var flow = [{"id":"flow","type":"tab"},{"id":"funcNode","type":"function","wires":[["goodNode"]],"func":"node.error('This is an error', msg);","x":0,"y":0,"z":"flow"},{"id":"goodNode","type":"helper","z":"flow"},{"id":"badNode","type":"helper","z":"flow"},{"id":"catchNode","type":"catch","scope":null,"uncaught":false,"wires":[["badNode"]],"z":"flow"}]; var catchNodeModule = require("nr-test-utils").require("@node-red/nodes/core/common/25-catch.js") helper.load([catchNodeModule, functionNode], flow, function() { var funcNode = helper.getNode("funcNode");