From c50d04af9eb033d82860c336fc7350b5c3f22242 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sat, 2 Apr 2022 09:43:51 +0200 Subject: [PATCH] fix(core): Fix crash on webhook when last node did not return data --- packages/cli/src/WebhookHelpers.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/cli/src/WebhookHelpers.ts b/packages/cli/src/WebhookHelpers.ts index 7b1e0b650b..b0e3844ceb 100644 --- a/packages/cli/src/WebhookHelpers.ts +++ b/packages/cli/src/WebhookHelpers.ts @@ -551,6 +551,7 @@ export async function executeWebhook( if (returnData.data!.main[0]![0] === undefined) { responseCallback(new Error('No item to return got found.'), {}); didSendResponse = true; + return undefined; } data = returnData.data!.main[0]![0].json; @@ -602,11 +603,13 @@ export async function executeWebhook( if (data === undefined) { responseCallback(new Error('No item to return got found.'), {}); didSendResponse = true; + return undefined; } if (data.binary === undefined) { responseCallback(new Error('No binary data to return got found.'), {}); didSendResponse = true; + return undefined; } const responseBinaryPropertyName = workflow.expression.getSimpleParameterValue(