add some checks to not throw IdNotFound exception for empty Quests (fixes #9)

This commit is contained in:
oliver 2015-04-09 15:52:11 +02:00
commit df7c22c8fc
7 changed files with 68 additions and 52 deletions

View file

@ -71,7 +71,6 @@
/**
* Get a Boss-Fight.
*
* @throws \nre\exceptions\IdNotFoundException
* @param int $questId ID of Quest
* @return array Boss-Fight data
*/
@ -84,12 +83,11 @@
'i',
$questId
);
if(empty($data)) {
throw new \nre\exceptions\IdNotFoundException($questId);
if(!empty($data)) {
return $data[0];
}
return $data[0];
return null;
}