aboutsummaryrefslogtreecommitdiff
path: root/model/Schedule.php
diff options
context:
space:
mode:
authorMaZderMind2016-12-21 16:50:58 +0100
committerMaZderMind2016-12-21 16:50:58 +0100
commit30adc57318a3bb84200cfb1bdf7ac765698d9406 (patch)
treea5221c123d480f304da26b9fe18af25009819ab1 /model/Schedule.php
parent83f3bd033eec9010d311cb22682e27f64a2bf56b (diff)
parent4d7e3732c1641308f7ad3fdf0f6e8afa78f5144b (diff)
Merge branch 'master' into events/33c3
Diffstat (limited to '')
-rw-r--r--model/Schedule.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/model/Schedule.php b/model/Schedule.php
index b54709e..917d70b 100644
--- a/model/Schedule.php
+++ b/model/Schedule.php
@@ -36,10 +36,10 @@ class Schedule
private function fetchSchedule()
{
- $schedule = file_get_contents($this->getScheduleCache());
+ $schedule = @file_get_contents($this->getScheduleCache());
if(!$schedule)
- throw new ScheduleException("Error Loading Schedule from ".$this->getScheduleCache());
+ return null;
return simplexml_load_string($schedule);
}
@@ -49,6 +49,11 @@ class Schedule
// download schedule-xml
$schedule = $this->fetchSchedule();
+ // not failing gracefully here will result in a broken page in case
+ // no schedule is present
+ if(!$schedule)
+ return [];
+
$mapping = $this->getScheduleToRoomSlugMapping();
$program = array();