Navigation Menu

Skip to content

Commit

Permalink
Merge branch 'MDL-46671-29' of https://github.com/pjking07/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Jan 12, 2015
2 parents 99334f6 + c8c746c commit 4c1a27c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion availability/classes/info_module.php
Expand Up @@ -180,7 +180,12 @@ public static function is_user_visible($cmorid, $userid = 0, $checkcourse = true
if (is_object($cmorid)) {
$cmorid = $cmorid->id;
}
$cm = $DB->get_record('course_modules', array('id' => $cmorid), '*', MUST_EXIST);
$cm = $DB->get_record('course_modules', array('id' => $cmorid));
if (!$cm) {
// In some error cases, the course module may not exist.
debugging('info_module::is_user_visible called with invalid cmid ' . $cmorid, DEBUG_DEVELOPER);
return false;
}
}

// If requested, check user can access the course.
Expand Down

0 comments on commit 4c1a27c

Please sign in to comment.