]> git.mjollnir.org Git - moodle.git/commitdiff
Prevent one warning
authorstronk7 <stronk7>
Sat, 4 Aug 2007 18:48:35 +0000 (18:48 +0000)
committerstronk7 <stronk7>
Sat, 4 Aug 2007 18:48:35 +0000 (18:48 +0000)
Merged from MOODLE_18_STABLE

lib/datalib.php

index bc99d8dbe4db83b0eb635b001ab111c2b2df4df8..1e22ba0c47ded37fc2444b285ac50624479ef41f 100644 (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;