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

Ensure flows exist before delegating status/error events

Fixes #1069
This commit is contained in:
Nick O'Leary 2017-01-09 16:39:41 +00:00
parent 489dbfc72a
commit e45cb7fac1
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -169,9 +169,9 @@ function getFlows() {
function delegateError(node,logMessage,msg) { function delegateError(node,logMessage,msg) {
if (activeFlows[node.z]) { if (activeFlows[node.z]) {
activeFlows[node.z].handleError(node,logMessage,msg); activeFlows[node.z].handleError(node,logMessage,msg);
} else if (activeNodesToFlow[node.z]) { } else if (activeNodesToFlow[node.z] && activeFlows[activeNodesToFlow[node.z]]) {
activeFlows[activeNodesToFlow[node.z]].handleError(node,logMessage,msg); activeFlows[activeNodesToFlow[node.z]].handleError(node,logMessage,msg);
} else if (activeFlowConfig.subflows[node.z]) { } else if (activeFlowConfig.subflows[node.z] && subflowInstanceNodeMap[node.id]) {
subflowInstanceNodeMap[node.id].forEach(function(n) { subflowInstanceNodeMap[node.id].forEach(function(n) {
delegateError(getNode(n),logMessage,msg); delegateError(getNode(n),logMessage,msg);
}); });
@ -193,7 +193,7 @@ function handleError(node,logMessage,msg) {
function delegateStatus(node,statusMessage) { function delegateStatus(node,statusMessage) {
if (activeFlows[node.z]) { if (activeFlows[node.z]) {
activeFlows[node.z].handleStatus(node,statusMessage); activeFlows[node.z].handleStatus(node,statusMessage);
} else if (activeNodesToFlow[node.z]) { } else if (activeNodesToFlow[node.z] && activeFlows[activeNodesToFlow[node.z]]) {
activeFlows[activeNodesToFlow[node.z]].handleStatus(node,statusMessage); activeFlows[activeNodesToFlow[node.z]].handleStatus(node,statusMessage);
} }
} }