From 56899c1a837cc194d3f156647f0fa49cc63e26d7 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 11 Jul 2023 14:40:47 +0200 Subject: [PATCH] fix(profile): fix getUID on nullable user variable 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 --- lib/private/Profile/ProfileManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Profile/ProfileManager.php b/lib/private/Profile/ProfileManager.php index 8de48994ff751..f20ae74768ea0 100644 --- a/lib/private/Profile/ProfileManager.php +++ b/lib/private/Profile/ProfileManager.php @@ -169,7 +169,7 @@ private function registerAction(ILinkAction $action, IUser $targetUser, ?IUser $ 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; } }