From: moodler Date: Fri, 27 Apr 2007 06:30:21 +0000 (+0000) Subject: Merged MDL-9606 from stable X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ca42eec162e4819066a432948ffd6707b4710a6f;p=moodle.git Merged MDL-9606 from stable --- diff --git a/calendar/lib.php b/calendar/lib.php index 2e9a6ac98d..d0b223fd4f 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -1239,7 +1239,9 @@ function calendar_get_default_courses($ignoreref = false) { // find all course this student can view if ($allcourses = get_my_courses($USER->id, 'visible DESC, sortorder ASC', '*', true)) { foreach ($allcourses as $courseid => $acourse) { - $context = get_context_instance(CONTEXT_COURSE, $courseid); + if (!$context = get_context_instance(CONTEXT_COURSE, $courseid)) { + continue; + } // let's try to see if there is any direct assignments on this context // one can have multiple assignments // just use anyone that has something, or else use empty string