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 <jus@bitgrid.net>
  • Loading branch information
juliusknorr authored and Julien Veyssier committed Sep 7, 2021
1 parent 643302b commit 021aa69
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/Service/ConfigService.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,18 @@ public function get($key) {
if ($this->getUserId() === null || !$this->groupManager->isAdmin($this->getUserId())) {
throw new NoPermissionException('You must be admin to get the group limit');
}
$result = $this->getGroupLimit();
break;
return $this->getGroupLimit();
case 'calendar':
if ($this->getUserId() === null) {
throw new NoPermissionException('Must be logged in to get the group limit');
return false;
}
$result = (bool)$this->config->getUserValue($this->getUserId(), Application::APP_ID, 'calendar', true);
break;
return (bool)$this->config->getUserValue($this->getUserId(), Application::APP_ID, 'calendar', true);
}
return $result;
}

public function isCalendarEnabled(int $boardId = null): bool {
if ($this->getUserId() === null) {
throw new NoPermissionException('Must be logged in to access user config');
return false;
}

$defaultState = (bool)$this->config->getUserValue($this->getUserId(), Application::APP_ID, 'calendar', true);
Expand Down

0 comments on commit 021aa69

Please sign in to comment.