From 49078f18535015a50613ce9295b6ce1489384bec Mon Sep 17 00:00:00 2001 From: fs Date: Tue, 14 Apr 2026 22:21:42 +0200 Subject: [PATCH] fix(scheduled-jobs): handle null last_run_status in jobs list data endpoint Jobs that have never run have last_run_status=NULL which caused a crash when calling ->value and ->badgeVariant() on null. Use explicit null checks instead of direct property access. Co-Authored-By: Claude Opus 4.6 (1M context) --- pages/admin/scheduled-jobs/data().php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/admin/scheduled-jobs/data().php b/pages/admin/scheduled-jobs/data().php index 7bfa423..739bd48 100644 --- a/pages/admin/scheduled-jobs/data().php +++ b/pages/admin/scheduled-jobs/data().php @@ -32,8 +32,8 @@ foreach ((array) ($result['rows'] ?? []) as $row) { 'schedule_summary' => $scheduledJobService->scheduleSummary($row), 'next_run_at' => dt((string) ($row['next_run_at'] ?? '')), 'last_run_finished_at' => dt((string) ($row['last_run_finished_at'] ?? '')), - 'last_run_status' => $status->value ?? '', - 'last_run_status_badge' => $status->badgeVariant(), + 'last_run_status' => $status !== null ? $status->value : '', + 'last_run_status_badge' => $status !== null ? $status->badgeVariant() : 'neutral', 'last_run_status_label' => $status !== null ? t($status->labelToken()) : '-', 'last_error' => trim((string) ($row['last_error_code'] ?? '')) !== '' ? trim((string) ($row['last_error_code'] ?? ''))