aboutsummaryrefslogtreecommitdiff
path: root/model/Schedule.php
diff options
context:
space:
mode:
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;
}