add some checks to not throw IdNotFound exception for empty Quests (fixes #9)
This commit is contained in:
parent
fed6d4a80c
commit
df7c22c8fc
7 changed files with 68 additions and 52 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue