mirror of
https://github.com/nextcloud/server.git
synced 2026-02-25 19:04:38 -05:00
Merge pull request #47889 from nextcloud/fix/settings-command
fix: `user:settings` command when user is not available
This commit is contained in:
commit
e4e9dae4e6
1 changed files with 5 additions and 2 deletions
|
|
@ -219,7 +219,7 @@ class Setting extends Base {
|
|||
}
|
||||
}
|
||||
|
||||
protected function getUserSettings($uid, $app) {
|
||||
protected function getUserSettings(string $uid, string $app): array {
|
||||
$settings = $this->config->getAllUserValues($uid);
|
||||
if ($app !== '') {
|
||||
if (isset($settings[$app])) {
|
||||
|
|
@ -230,7 +230,10 @@ class Setting extends Base {
|
|||
}
|
||||
|
||||
$user = $this->userManager->get($uid);
|
||||
$settings['settings']['display_name'] = $user->getDisplayName();
|
||||
if ($user !== null) {
|
||||
// Only add the display name if the user exists
|
||||
$settings['settings']['display_name'] = $user->getDisplayName();
|
||||
}
|
||||
|
||||
return $settings;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue