fix(core): Handle missing resultData in runData (#7523)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-10-26 13:15:19 +02:00 committed by GitHub
parent d8ec6eac40
commit 1055bd3762
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -73,8 +73,8 @@ export class WorkflowRunner {
/**
* The process did send a hook message so execute the appropriate hook
*/
processHookMessage(workflowHooks: WorkflowHooks, hookData: IProcessMessageDataHook) {
void workflowHooks.executeHookFunctions(hookData.hook, hookData.parameters);
async processHookMessage(workflowHooks: WorkflowHooks, hookData: IProcessMessageDataHook) {
await workflowHooks.executeHookFunctions(hookData.hook, hookData.parameters);
}
/**
@ -777,7 +777,7 @@ export class WorkflowRunner {
workflowHooks,
);
} else if (message.type === 'processHook') {
this.processHookMessage(workflowHooks, message.data as IProcessMessageDataHook);
await this.processHookMessage(workflowHooks, message.data as IProcessMessageDataHook);
} else if (message.type === 'timeout') {
// Execution timed out and its process has been terminated
const timeoutError = new WorkflowOperationError('Workflow execution timed out!');

View file

@ -11,7 +11,7 @@ export function determineFinalExecutionStatus(runData: IRun): ExecutionStatus {
const workflowHasCrashed = runData.status === 'crashed';
const workflowWasCanceled = runData.status === 'canceled';
const workflowDidSucceed =
!runData.data.resultData.error && !workflowHasCrashed && !workflowWasCanceled;
!runData.data.resultData?.error && !workflowHasCrashed && !workflowWasCanceled;
let workflowStatusFinal: ExecutionStatus = workflowDidSucceed ? 'success' : 'failed';
if (workflowHasCrashed) workflowStatusFinal = 'crashed';
if (workflowWasCanceled) workflowStatusFinal = 'canceled';