Skip to content

Commit

Permalink
Return false instead of throwing when getting calendar integration se…
Browse files Browse the repository at this point in the history
…tting

Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Sep 8, 2021
1 parent 82e3400 commit bfe9b05
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/Service/ConfigService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bfe9b05

Please sign in to comment.