diff options
author | Andy Scherzinger <info@andy-scherzinger.de> | 2025-01-28 23:02:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-28 23:02:24 +0100 |
commit | f752a017222ff6cd342a6dbd0e07333ba6b6935d (patch) | |
tree | 9c6ac0e1a2f6b77a35c591c9fa71a4ed21b37060 | |
parent | fe352bf2120fdb0bb03d3b9327240b1dbba371db (diff) | |
parent | 00286eefa819110ec88c05a5e115690f4f7a7cba (diff) | |
download | nextcloud-server-f752a017222ff6cd342a6dbd0e07333ba6b6935d.tar.gz nextcloud-server-f752a017222ff6cd342a6dbd0e07333ba6b6935d.zip |
Merge pull request #50492 from nextcloud/backport/47889/stable31
[stable31] 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; } |