]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(profile): fix getUID on nullable user variable 39437/head
authorThomas Citharel <tcit@tcit.fr>
Tue, 11 Jul 2023 12:40:47 +0000 (14:40 +0200)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Mon, 17 Jul 2023 13:33:58 +0000 (13:33 +0000)
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 ddc0670604b55beb2067b14ae3dfadd60d20ad8c..8a0152bcf718106ccf991b4379ff26659865ae34 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;
                        }
                }