From 5706d6fe14b6e01828c2dc5e199dfa81d25324b8 Mon Sep 17 00:00:00 2001 From: coderkun Date: Tue, 4 Mar 2014 12:04:56 +0100 Subject: [PATCH] correct permissions checking for previous Questgroups if there is none --- controllers/QuestsController.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/QuestsController.inc b/controllers/QuestsController.inc index e6e7ce54..8ce5705c 100644 --- a/controllers/QuestsController.inc +++ b/controllers/QuestsController.inc @@ -77,7 +77,7 @@ { // Previous Questgroup $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(); } } @@ -216,7 +216,7 @@ { // Previous Questgroup $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(); } }