diff options
author | Andreas Hubel | 2020-10-31 21:13:03 +0100 |
---|---|---|
committer | Andreas Hubel | 2020-10-31 21:13:03 +0100 |
commit | c7bee023a4e00c48edd092c0bfe93d4cd650eff5 (patch) | |
tree | 86ef383b9bfc22aef88ae8c975c77bee1c493dd2 /model/Schedule.php | |
parent | c31a16cb6d9057883cc5f46376c190a8a8736546 (diff) |
bugfix for empty schedule
Diffstat (limited to 'model/Schedule.php')
-rw-r--r-- | model/Schedule.php | 8 |
1 files changed, 5 insertions, 3 deletions
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; } |