diff options
-rw-r--r-- | core/Controller/ProfilePageController.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/core/Controller/ProfilePageController.php b/core/Controller/ProfilePageController.php index e4064370d9c..505dfa4e249 100644 --- a/core/Controller/ProfilePageController.php +++ b/core/Controller/ProfilePageController.php @@ -127,13 +127,15 @@ class ProfilePageController extends Controller { } } - $userStatuses = $this->userStatusManager->getUserStatuses([$targetUserId]); - $status = $userStatuses[$targetUserId] ?? null; - if ($status !== null) { - $this->initialStateService->provideInitialState('status', [ - 'icon' => $status->getIcon(), - 'message' => $status->getMessage(), - ]); + if ($visitingUser !== null) { + $userStatuses = $this->userStatusManager->getUserStatuses([$targetUserId]); + $status = $userStatuses[$targetUserId] ?? null; + if ($status !== null) { + $this->initialStateService->provideInitialState('status', [ + 'icon' => $status->getIcon(), + 'message' => $status->getMessage(), + ]); + } } $this->initialStateService->provideInitialState( |