From 4cd31ce343528e8b666b69d56c19466ef5403437 Mon Sep 17 00:00:00 2001 From: Alessio Gravili Date: Sun, 1 Dec 2024 19:31:17 -0700 Subject: [PATCH] fix: prevent workflow destructuring errors for failing tasks (#9649) When destructuring the output of task in a job workflow handler, there is a chance of a destructuring error being thrown if the task fails --- .../src/queues/operations/runJobs/runJob/getRunTaskFunction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/payload/src/queues/operations/runJobs/runJob/getRunTaskFunction.ts b/packages/payload/src/queues/operations/runJobs/runJob/getRunTaskFunction.ts index 33dff047824..f929fcafce2 100644 --- a/packages/payload/src/queues/operations/runJobs/runJob/getRunTaskFunction.ts +++ b/packages/payload/src/queues/operations/runJobs/runJob/getRunTaskFunction.ts @@ -231,7 +231,7 @@ export const getRunTaskFunction = ( return } - let output: object + let output: object = {} try { const runnerOutput = await runner({