From a68c8ae6d21185fc13825739900ce9d11a636ddf Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Fri, 8 Oct 2021 15:38:58 +0200 Subject: [PATCH] Fixes #824: Server error when no shifts configured and with 'user_shifts' as home site --- includes/pages/user_shifts.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index 3fde65e2..debb9b41 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -49,7 +49,10 @@ function update_ShiftsFilter_timerange(ShiftsFilter $shiftsFilter, $days) { $start_time = $shiftsFilter->getStartTime(); if (is_null($start_time)) { - $first_day = DateTime::createFromFormat('Y-m-d', $days[0])->getTimestamp(); + $first_day = DateTime::createFromFormat( + 'Y-m-d', + $days[0] ?? (new DateTime())->format('Y-m-d') + )->getTimestamp(); if(time() < $first_day) { $start_time = $first_day; } else {