]> git.mjollnir.org Git - moodle.git/commitdiff
fixing a warning when variable is not an object
authortoyomoyo <toyomoyo>
Thu, 20 Sep 2007 02:45:59 +0000 (02:45 +0000)
committertoyomoyo <toyomoyo>
Thu, 20 Sep 2007 02:45:59 +0000 (02:45 +0000)
calendar/lib.php

index 1eac3efa43b107b7c2984a71f0e7d1c2570ae3d7..5dbb42849a65a416e03617137f02837e61669d93 100644 (file)
@@ -1315,7 +1315,9 @@ function calendar_set_filters(&$courses, &$group, &$user, $courseeventsfrom = NU
             foreach($groupcourses as $courseid) {
 
                 if (!isset($courseeventsfrom[$courseid]->context)) { // SHOULD be set MDL-11221
-                    $courseeventsfrom[$courseid]->context = get_context_instance(CONTEXT_COURSE, $courseid);
+                    if (is_object($courseeventsfrom[$courseid])) {
+                        $courseeventsfrom[$courseid]->context = get_context_instance(CONTEXT_COURSE, $courseid);
+                    }
                 }
 
                 // If the user is an editing teacher in there,