MDL-82499 question: Fail if questionid does not exist.

This commit is contained in:
Michael Aherne
2024-07-16 14:39:02 +01:00
committed by GitHub
parent fd487cd3f2
commit 5605d64389
+1 -1
View File
@@ -1465,7 +1465,7 @@ function question_has_capability_on($questionorid, $cap, $notused = -1): bool {
WHERE q.id = :id';
// Well, at least we tried. Seems that we really have to read from DB.
$question = $DB->get_record_sql($sql, ['id' => $questionid]);
$question = $DB->get_record_sql($sql, ['id' => $questionid], MUST_EXIST);
}
}