MDL-22054 skip loading of missing modules
[moodle.git] / lib / moodlelib.php
index bd8d343..f04aad3 100644 (file)
@@ -2825,6 +2825,10 @@ function &get_fast_modinfo(&$course, $userid=0) {
                 $minimalmodinfo=new stdClass();
                 $minimalmodinfo->cms=array();
                 foreach($info as $mod) {
+                    if (empty($mod->name)) {
+                        // something is wrong here
+                        continue;
+                    }
                     $minimalcm = new stdClass();
                     $minimalcm->id = $mod->cm;
                     $minimalcm->name = $mod->name;