}
$question = $questions[$question];
}
+ if (empty($question->category)) {
+ // This can happen when we have created a fake 'missingtype' question to
+ // take the place of a deleted question.
+ return false;
+ }
if (!isset($categories[$question->category])) {
if (!$categories[$question->category] = $DB->get_record('question_categories',
array('id'=>$question->category))) {