Permalink
Browse files

MDL-18351: activity block: detect when there's no course (eg admin pa…

…ge) and return
  • Loading branch information...
mjollnir_
mjollnir_ committed Feb 23, 2009
1 parent 4d5f391 commit 6a00dfa3259af0237e139d45d7322e01bead68ed
Showing with 4 additions and 0 deletions.
  1. +4 −0 blocks/activity_modules/block_activity_modules.php
@@ -24,6 +24,10 @@ function get_content() {
$course = get_record('course', 'id', $this->instance->pageid);
}
+ if (empty($course)) {
+ return '';
+ }
+
require_once($CFG->dirroot.'/course/lib.php');
$modinfo = get_fast_modinfo($course);

0 comments on commit 6a00dfa

Please sign in to comment.