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 <tcit@tcit.fr>
pull/39309/head
Thomas Citharel 3 years ago
parent 5c6ed30369
commit cd9dac1d20
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
  1. 2
      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;
}
}

Loading…
Cancel
Save