]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(profile): fix getUID on nullable user variable 39309/head
authorThomas Citharel <tcit@tcit.fr>
Tue, 11 Jul 2023 12:40:47 +0000 (14:40 +0200)
committerThomas Citharel <tcit@tcit.fr>
Tue, 11 Jul 2023 12:41:58 +0000 (14:41 +0200)
As per method signature, $visitingUser is nullable, so we can't be sure calling getUid() on it will
work.

Closes #35766

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
lib/private/Profile/ProfileManager.php

index 8de48994ff751db3ba0e65dacc7fd1d7398868bc..f20ae74768ea019383d0b17693b1fd1d0b6cd850 100644 (file)
@@ -169,7 +169,7 @@ class ProfileManager {
                                return;
                        }
                        if (!$this->appManager->isEnabledForUser($action->getAppId(), $visitingUser)) {
-                               $this->logger->notice('App: ' . $action->getAppId() . ' cannot register actions as it is not enabled for the visiting user: ' . $visitingUser->getUID());
+                               $this->logger->notice('App: ' . $action->getAppId() . ' cannot register actions as it is not enabled for the visiting user: ' . ($visitingUser ? $visitingUser->getUID() : '(user not connected)'));
                                return;
                        }
                }