Permalink
Browse files

Merge branch 'MDL-28687_21' of git://github.com/timhunt/moodle into M…

…OODLE_21_STABLE
  • Loading branch information...
2 parents 35dd038 + 3575052 commit e9f8af2a1b56f9126fcf84576ee05527ddb6f377 @nebgor nebgor committed Aug 23, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/questionlib.php
View
5 lib/questionlib.php
@@ -1343,6 +1343,11 @@ function question_has_capability_on($question, $cap, $cachecat = -1) {
}
$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))) {

0 comments on commit e9f8af2

Please sign in to comment.