From: tjhunt Date: Thu, 4 Sep 2008 04:52:29 +0000 (+0000) Subject: MDL-15452 - forgot to check a DB call for errors. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=45da388f6da0d1df40887796f4880d754e011743;p=moodle.git MDL-15452 - forgot to check a DB call for errors. --- diff --git a/mod/quiz/locallib.php b/mod/quiz/locallib.php index e287248693..60efc87057 100644 --- a/mod/quiz/locallib.php +++ b/mod/quiz/locallib.php @@ -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