Browse Source

Merge pull request #47889 from nextcloud/fix/settings-command

fix: `user:settings` command when user is not available
pull/50496/head
Côme Chilliet 11 months ago
committed by GitHub
parent
commit
e4e9dae4e6
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 7
      core/Command/User/Setting.php

7
core/Command/User/Setting.php

@ -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…
Cancel
Save