mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:50:42 +00:00
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) <noreply@anthropic.com>
This commit is contained in:
committed by
Gustavo Madeira Santana
parent
074fabc540
commit
a1a08e27db
@@ -86,9 +86,10 @@ async function loadStateFile(statePath: string): Promise<CronStateFile | null> {
|
||||
}
|
||||
}
|
||||
|
||||
function hasInlineState(jobs: Array<Record<string, unknown>>): boolean {
|
||||
function hasInlineState(jobs: Array<Record<string, unknown> | null | undefined>): boolean {
|
||||
return jobs.some(
|
||||
(job) =>
|
||||
job != null &&
|
||||
job.state !== undefined &&
|
||||
typeof job.state === "object" &&
|
||||
job.state !== null &&
|
||||
|
||||
Reference in New Issue
Block a user