diff --git a/app/controllers/calendar/schedule.php b/app/controllers/calendar/schedule.php index 52c6f36c9e8bc113bb42e4432fe39087be3327a7..6fb51c401e254c61e3ca8a7136352ee8f2e04650 100644 --- a/app/controllers/calendar/schedule.php +++ b/app/controllers/calendar/schedule.php @@ -243,7 +243,11 @@ class Calendar_ScheduleController extends AuthenticatedController $this->render_template('calendar/schedule/_entry_course'); } else if ($id) { $entry_columns = CalendarScheduleModel::getScheduleEntries($GLOBALS['user']->id, 0, 0, $id); - $entries = array_pop($entry_columns)->getEntries(); + $entries = []; + $entry_columns = array_pop($entry_columns); + if ($entry_columns) { + $entries = $entry_columns->getEntries(); + } $this->show_entry = array_pop($entries); $this->render_template('calendar/schedule/_entry_schedule'); }