Skip to content

Commit

Permalink
fix(core): Fix crash on webhook when last node did not return data
Browse files Browse the repository at this point in the history
  • Loading branch information
janober committed Apr 2, 2022
1 parent 6bbb4df commit c50d04a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/cli/src/WebhookHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit c50d04a

Please sign in to comment.