From 939dec1348d352aceafb508fa258f80bab9c5731 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Fri, 28 Aug 2026 02:11:35 +0530 Subject: [PATCH] fix: harden _is_recoverable_error_job against schedule=None job.get("schedule", {}).get("kind") crashes with AttributeError when schedule is present but explicitly None (disk corruption edge case). Use (job.get("schedule") or {}).get("kind") instead, which safely returns False for None. This pattern is already used at other sites in the file (e.g. cron/scheduler.py line 170). --- cron/jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cron/jobs.py b/cron/jobs.py index ce55cbac1b..4b37d8537a 100644 --- a/cron/jobs.py +++ b/cron/jobs.py @@ -667,7 +667,7 @@ def _is_recoverable_error_job(job: Dict[str, Any]) -> bool: """ return ( job.get("state") == "error" - and job.get("schedule", {}).get("kind") in {"cron", "interval"} + and (job.get("schedule") or {}).get("kind") in {"cron", "interval"} )