mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
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:
parent
121ff1f93f
commit
2a42e8954f
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user