Skip to content

Commit

Permalink
Dev: Throw exception if question is curropt (has no type)
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Mar 21, 2016
1 parent 3b9df36 commit f5a244d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions application/models/QuestionAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ public function getQuestionAttributes($iQuestionID)

// Get all atribute set for this question
$sType=$oQuestion->type;

// For some reason this happened in bug #10684
if ($sType == null)
{
throw new \CException("Question is curropt: no type defined for question " . $iQuestionID);
}

$aAttributeNames = questionAttributes();
$aAttributeNames = $aAttributeNames[$sType];
$oAttributeValues = QuestionAttribute::model()->findAll("qid=:qid",array('qid'=>$iQuestionID));
Expand Down

0 comments on commit f5a244d

Please sign in to comment.