From: toyomoyo Date: Thu, 20 Sep 2007 02:45:59 +0000 (+0000) Subject: fixing a warning when variable is not an object X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=8397874d1b8373701b15938841614276f65b888f;p=moodle.git fixing a warning when variable is not an object --- diff --git a/calendar/lib.php b/calendar/lib.php index 1eac3efa43..5dbb42849a 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -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,