Question getter now return null if the question isn't found
This commit is contained in:
parent
ec83fb3121
commit
e90a1813ae
@ -52,7 +52,11 @@ class QuestionsFile
|
|||||||
*/
|
*/
|
||||||
public function get_question($id)
|
public function get_question($id)
|
||||||
{
|
{
|
||||||
return new Question($this->treeXML->getElementById($id));
|
$q = $this->treeXML->getElementById($id);
|
||||||
|
if (isset($q))
|
||||||
|
return new Question($q);
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user