From: Thomas Citharel Date: Tue, 11 Jul 2023 12:40:47 +0000 (+0200) Subject: fix(profile): fix getUID on nullable user variable X-Git-Tag: v28.0.0beta1~698^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cd9dac1d203cdd2a545207e59fdb27883416446c;p=nextcloud-server.git 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 --- diff --git a/lib/private/Profile/ProfileManager.php b/lib/private/Profile/ProfileManager.php index 8de48994ff7..f20ae74768e 100644 --- a/lib/private/Profile/ProfileManager.php +++ b/lib/private/Profile/ProfileManager.php @@ -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; } }