diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2025-01-28 09:37:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-28 09:37:16 +0100 |
commit | e4e9dae4e62831e0125cf4df1dc574e9baa6313a (patch) | |
tree | 96cce089e1b336ff6821428f753f4c4dd0614c08 | |
parent | 0180e8c2ed4ebb0c2ca00de0a1bb16007e44957e (diff) | |
parent | 5867231247d240f51efbe00f32f963a957373c46 (diff) | |
download | nextcloud-server-e4e9dae4e62831e0125cf4df1dc574e9baa6313a.tar.gz nextcloud-server-e4e9dae4e62831e0125cf4df1dc574e9baa6313a.zip |
Merge pull request #47889 from nextcloud/fix/settings-command
fix: `user:settings` command when user is not available
-rw-r--r-- | core/Command/User/Setting.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/Command/User/Setting.php b/core/Command/User/Setting.php index e2e65f7d5f9..16e851d8252 100644 --- a/core/Command/User/Setting.php +++ b/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; } |