Skip to content

Commit

Permalink
fix(profile): fix getUID on nullable user variable
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tcitworld authored and backportbot-nextcloud[bot] committed Jul 17, 2023
1 parent f8cac22 commit e640bb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/private/Profile/ProfileManager.php
Expand Up @@ -168,7 +168,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;
}
}
Expand Down

0 comments on commit e640bb3

Please sign in to comment.