diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php index b36f0e607..0ca6ab178 100644 --- a/lib/Service/ConfigService.php +++ b/lib/Service/ConfigService.php @@ -73,16 +73,20 @@ public function get($key) { if (!$this->groupManager->isAdmin($this->userId)) { throw new NoPermissionException('You must be admin to get the group limit'); } - $result = $this->getGroupLimit(); - break; + return $this->getGroupLimit(); case 'calendar': - $result = (bool)$this->config->getUserValue($this->userId, Application::APP_ID, 'calendar', true); - break; + if ($this->userId === null) { + return false; + } + return (bool)$this->config->getUserValue($this->userId, Application::APP_ID, 'calendar', true); } - return $result; } public function isCalendarEnabled(int $boardId = null): bool { + if ($this->userId === null) { + return false; + } + $defaultState = (bool)$this->config->getUserValue($this->userId, Application::APP_ID, 'calendar', true); if ($boardId === null) { return $defaultState;