]> git.mjollnir.org Git - moodle.git/commitdiff
Merged MDL-9606 from stable
authormoodler <moodler>
Fri, 27 Apr 2007 06:30:21 +0000 (06:30 +0000)
committermoodler <moodler>
Fri, 27 Apr 2007 06:30:21 +0000 (06:30 +0000)
calendar/lib.php

index 2e9a6ac98db3180b60e453e9574f720eff60eec3..d0b223fd4fcbf7d675b9f842e108f22f94125f3e 100644 (file)
@@ -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