From 5eea3cd6d0b59963dc7c7a9e1ca597137cf3ce98 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 9 Jun 2022 13:59:52 +0200 Subject: [PATCH] fix(core): Fix issue when a node does not return data --- packages/core/src/WorkflowExecute.ts | 40 +++++++++++++++------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/packages/core/src/WorkflowExecute.ts b/packages/core/src/WorkflowExecute.ts index 79fcff4e14..3bd64566e0 100644 --- a/packages/core/src/WorkflowExecute.ts +++ b/packages/core/src/WorkflowExecute.ts @@ -939,26 +939,28 @@ export class WorkflowExecute { workflowId: workflow.id, }); - // Check if the output data contains pairedItem data - checkOutputData: for (const outputData of nodeSuccessData as INodeExecutionData[][]) { - if (outputData === null) { - continue; - } - for (const item of outputData) { - if (!item.pairedItem) { - // The pairedItem is missing so check if it can get automatically fixed - if ( - executionData.data.main.length !== 1 || - executionData.data.main[0]?.length !== 1 - ) { - // Automatically fixing is only possible if there is only one - // input and one input item - break checkOutputData; - } + if (nodeSuccessData) { + // Check if the output data contains pairedItem data + checkOutputData: for (const outputData of nodeSuccessData) { + if (outputData === null) { + continue; + } + for (const item of outputData) { + if (!item.pairedItem) { + // The pairedItem is missing so check if it can get automatically fixed + if ( + executionData.data.main.length !== 1 || + executionData.data.main[0]?.length !== 1 + ) { + // Automatically fixing is only possible if there is only one + // input and one input item + break checkOutputData; + } - item.pairedItem = { - item: 0, - }; + item.pairedItem = { + item: 0, + }; + } } } }