correct permissions checking for previous Questgroups if there is none

This commit is contained in:
coderkun 2014-03-04 12:04:56 +01:00
commit 9c91c0c211

View file

@ -77,7 +77,7 @@
{ {
// Previous Questgroup // Previous Questgroup
$previousQuestgroup = $this->Questgroups->getPreviousQuestgroup($questgroup['id']); $previousQuestgroup = $this->Questgroups->getPreviousQuestgroup($questgroup['id']);
if(!$this->Questgroups->hasCharacterSolvedQuestgroup($previousQuestgroup['id'], $character['id'])) { if(!is_null($previousQuestgroup) && !$this->Questgroups->hasCharacterSolvedQuestgroup($previousQuestgroup['id'], $character['id'])) {
throw new \nre\exceptions\AccessDeniedException(); throw new \nre\exceptions\AccessDeniedException();
} }
} }
@ -216,7 +216,7 @@
{ {
// Previous Questgroup // Previous Questgroup
$previousQuestgroup = $this->Questgroups->getPreviousQuestgroup($questgroup['id']); $previousQuestgroup = $this->Questgroups->getPreviousQuestgroup($questgroup['id']);
if(!$this->Questgroups->hasCharacterSolvedQuestgroup($previousQuestgroup['id'], $character['id'])) { if(!is_null($previousQuestgroup) && !$this->Questgroups->hasCharacterSolvedQuestgroup($previousQuestgroup['id'], $character['id'])) {
throw new \nre\exceptions\AccessDeniedException(); throw new \nre\exceptions\AccessDeniedException();
} }
} }