From a1a08e27db41a01268f95497b3d786a3f60ceaeb Mon Sep 17 00:00:00 2001 From: Feelw00 Date: Thu, 9 Apr 2026 09:08:04 +0900 Subject: [PATCH] fix(cron): guard hasInlineState against null/undefined job entries Legacy jobs arrays may contain null items. hasInlineState now skips them instead of throwing, preserving prior fault-tolerant behavior. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/cron/store.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cron/store.ts b/src/cron/store.ts index 57554af8f9f..b0c9aa1c168 100644 --- a/src/cron/store.ts +++ b/src/cron/store.ts @@ -86,9 +86,10 @@ async function loadStateFile(statePath: string): Promise { } } -function hasInlineState(jobs: Array>): boolean { +function hasInlineState(jobs: Array | null | undefined>): boolean { return jobs.some( (job) => + job != null && job.state !== undefined && typeof job.state === "object" && job.state !== null &&