]> git.mjollnir.org Git - moodle.git/commitdiff
fixed warning; merged from MODOLE_18_STABLE
authorskodak <skodak>
Sun, 15 Apr 2007 21:09:05 +0000 (21:09 +0000)
committerskodak <skodak>
Sun, 15 Apr 2007 21:09:05 +0000 (21:09 +0000)
calendar/lib.php

index 0ab3790eb42befe7f29dcf0fa767ac9085bde267..2e9a6ac98db3180b60e453e9574f720eff60eec3 100644 (file)
@@ -1110,8 +1110,10 @@ function calendar_set_filters(&$courses, &$group, &$user, $courseeventsfrom = NU
     }
     //BUG 6130 clean $courses array as SESSION has bad entries. 
     // [pj] TODO: See if this has to do with my new change in get_default_courses and can be taken out
-    foreach ($courses as $index => $value) {
-        if (empty($value)) unset($courses[$index]);
+    if (is_array($courses)) {
+        foreach ($courses as $index => $value) {
+            if (empty($value)) unset($courses[$index]);
+        }
     }
 
     if($SESSION->cal_show_user || $ignorefilters) {