Avoid Error when getSchedule does not return a mutuable Array

This commit is contained in:
MaZderMind 2015-03-31 17:06:04 +02:00
parent 8b7ab95ad4
commit beb6da0a82

View file

@ -183,7 +183,8 @@ class Schedule extends ModelBase
public function getDurationSum()
{
$sum = 0;
foreach(reset($this->getSchedule()) as $event)
$schedule = $this->getSchedule();
foreach(reset($schedule) as $event)
$sum += $event['duration'];
return $sum;