aboutsummaryrefslogtreecommitdiff
path: root/model/Schedule.php
diff options
context:
space:
mode:
authorAndreas Hubel2020-10-31 21:13:03 +0100
committerAndreas Hubel2020-10-31 21:13:03 +0100
commitc7bee023a4e00c48edd092c0bfe93d4cd650eff5 (patch)
tree86ef383b9bfc22aef88ae8c975c77bee1c493dd2 /model/Schedule.php
parentc31a16cb6d9057883cc5f46376c190a8a8736546 (diff)
bugfix for empty schedule
Diffstat (limited to 'model/Schedule.php')
-rw-r--r--model/Schedule.php8
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;
}