fix(core): Fix crash on webhook when last node did not return data

This commit is contained in:
Jan Oberhauser 2022-04-02 09:43:51 +02:00
parent 6bbb4df059
commit c50d04af9e

View file

@ -551,6 +551,7 @@ export async function executeWebhook(
if (returnData.data!.main[0]![0] === undefined) { if (returnData.data!.main[0]![0] === undefined) {
responseCallback(new Error('No item to return got found.'), {}); responseCallback(new Error('No item to return got found.'), {});
didSendResponse = true; didSendResponse = true;
return undefined;
} }
data = returnData.data!.main[0]![0].json; data = returnData.data!.main[0]![0].json;
@ -602,11 +603,13 @@ export async function executeWebhook(
if (data === undefined) { if (data === undefined) {
responseCallback(new Error('No item to return got found.'), {}); responseCallback(new Error('No item to return got found.'), {});
didSendResponse = true; didSendResponse = true;
return undefined;
} }
if (data.binary === undefined) { if (data.binary === undefined) {
responseCallback(new Error('No binary data to return got found.'), {}); responseCallback(new Error('No binary data to return got found.'), {});
didSendResponse = true; didSendResponse = true;
return undefined;
} }
const responseBinaryPropertyName = workflow.expression.getSimpleParameterValue( const responseBinaryPropertyName = workflow.expression.getSimpleParameterValue(