From 8397874d1b8373701b15938841614276f65b888f Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Thu, 20 Sep 2007 02:45:59 +0000 Subject: [PATCH] fixing a warning when variable is not an object --- calendar/lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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, -- 2.39.5