Skip to content

Commit 05cda91

Browse files
committed
MDL-58001 mod_assign: Catch exception if grade item cannot be loaded
1 parent 5b17310 commit 05cda91

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

mod/assign/locallib.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8701,7 +8701,11 @@ protected function reopen_submission_if_required($userid, $submission, $addattem
87018701
break;
87028702
case ASSIGN_ATTEMPT_REOPEN_METHOD_UNTILPASS:
87038703
// Check the gradetopass from the gradebook.
8704-
$gradeitem = $this->get_grade_item();
8704+
try {
8705+
$gradeitem = $this->get_grade_item();
8706+
} catch (coding_exception) {
8707+
return false;
8708+
}
87058709
if ($gradeitem) {
87068710
$gradegrade = grade_grade::fetch(['userid' => $userid, 'itemid' => $gradeitem->id]);
87078711

0 commit comments

Comments
 (0)