From 1f724fb6123b2a1020978ad40652b5b9f4e64750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 4 Feb 2020 16:44:11 +0100 Subject: [PATCH] Fix undefined users variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Service/PermissionService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Service/PermissionService.php b/lib/Service/PermissionService.php index f21372daa..d5aa4b761 100644 --- a/lib/Service/PermissionService.php +++ b/lib/Service/PermissionService.php @@ -234,11 +234,11 @@ class PermissionService { return []; } + $users = []; $owner = $this->userManager->get($board->getOwner()); if ($owner === null) { $this->logger->info('No owner found for board ' . $board->getId()); } else { - $users = []; $users[$owner->getUID()] = new User($owner); } $acls = $this->aclMapper->findAll($boardId); @@ -270,7 +270,7 @@ class PermissionService { $this->logger->info('No circle found for acl rule ' . $acl->getId()); continue; } - + foreach ($circle->getMembers() as $member) { $user = $this->userManager->get($member->getUserId()); if ($user === null) { @@ -278,7 +278,7 @@ class PermissionService { } else { $users[$member->getUserId()] = new User($user); } - } + } } catch (\Exception $e) { $this->logger->info('Member not found in circle that was accessed. This should not happen.'); }