Prevent one warning

Merged from MOODLE_18_STABLE
This commit is contained in:
stronk7 2007-08-04 18:48:35 +00:00
parent d660c423fd
commit 42fa499221

View File

@ -833,7 +833,7 @@ function get_my_courses($userid, $sort=NULL, $fields=NULL, $doanything=false,$li
$USER->mycourses[$doanything] = $mycourses;
}
if ($reallimit) {
if (!empty($mycourses) && $reallimit) {
return array_slice($mycourses, 0, $reallimit, true);
} else {
return $mycourses;