MDL-18351: activity block: detect when there's no course (eg admin page) and return (merged from MOODLE_19_STABLE)

This commit is contained in:
mjollnir_ 2009-02-23 14:49:05 +00:00
parent 121ff1f93f
commit 2a42e8954f

View File

@ -24,6 +24,10 @@ class block_activity_modules extends block_list {
$course = $DB->get_record('course', array('id'=>$this->instance->pageid));
}
if (empty($course)) {
return '';
}
require_once($CFG->dirroot.'/course/lib.php');
$modinfo = get_fast_modinfo($course);