]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15452 - forgot to check a DB call for errors.
authortjhunt <tjhunt>
Thu, 4 Sep 2008 04:52:29 +0000 (04:52 +0000)
committertjhunt <tjhunt>
Thu, 4 Sep 2008 04:52:29 +0000 (04:52 +0000)
mod/quiz/locallib.php

index e287248693fe144e4f2a22cfc6ef189ddda2fe05..60efc8705735fbe9dd392f16a8153871f428e304 100644 (file)
@@ -156,6 +156,9 @@ function quiz_get_latest_attempt_by_user($quizid, $userid) {
 function quiz_load_attempt($attemptid) {
     global $DB;
     $attempt = $DB->get_record('quiz_attempts', array('id' => $attemptid));
+    if (!$attempt) {
+        return false;
+    }
 
     if (!$DB->record_exists('question_sessions', array('attemptid' => $attempt->uniqueid))) {
     /// this attempt has not yet been upgraded to the new model