diff options
Diffstat (limited to '')
-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; } |