From c7bee023a4e00c48edd092c0bfe93d4cd650eff5 Mon Sep 17 00:00:00 2001 From: Andreas Hubel Date: Sat, 31 Oct 2020 21:13:03 +0100 Subject: bugfix for empty schedule --- model/Schedule.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'model') diff --git a/model/Schedule.php b/model/Schedule.php index 739d2c8..52eac4e 100644 --- a/model/Schedule.php +++ b/model/Schedule.php @@ -295,9 +295,11 @@ class Schedule { $sum = 0; $schedule = $this->getSchedule(); - foreach(reset($schedule) as $event) - $sum += $event['duration']; - + if ($schedule) { + foreach(reset($schedule) as $event) { + $sum += $event['duration']; + } + } return $sum; } -- cgit v1.2.3