Skip to content

Commit

Permalink
fix npe
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasKaminsky committed Dec 17, 2024
1 parent 6b95763 commit 8ac5380
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ public function __construct(IUserSession $userSession,

public function getCapabilities(): array {
$user = $this->userSession->getUser();
$enabled = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'enabled', 'true') === 'true';

if ($user === null) {
$enabled = false;
} else {
$enabled = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'enabled', 'true') === 'true';
}

return ['recommendations' =>
[
Expand Down

0 comments on commit 8ac5380

Please sign in to comment.