diff --git a/app/controllers/calendar/schedule.php b/app/controllers/calendar/schedule.php index bdd0f51c2b4597c49ce2c7a307dc11f4ecd55df8..88c4304ab48ea957f1611276df270417fc6e1cb0 100644 --- a/app/controllers/calendar/schedule.php +++ b/app/controllers/calendar/schedule.php @@ -243,8 +243,12 @@ 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(); - $this->show_entry = array_pop($entries); + if (count($entry_columns) > 0) { + $entries = array_pop($entry_columns)->getEntries(); + $this->show_entry = array_pop($entries); + } else { + $this->show_entry = null; + } $this->render_template('calendar/schedule/_entry_schedule'); } } else {