From 04f36302b8e2840322a9bf0e8bed96ded165cd12 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Tue, 2 Apr 2024 13:10:39 -0300 Subject: [PATCH] fix: prevent error when current user don't have an email Signed-off-by: Vitor Mattos --- lib/Controller/IdentifyAccountController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Controller/IdentifyAccountController.php b/lib/Controller/IdentifyAccountController.php index 5f65ee38cb..3926a9c41b 100644 --- a/lib/Controller/IdentifyAccountController.php +++ b/lib/Controller/IdentifyAccountController.php @@ -151,6 +151,9 @@ private function addHerselfEmail(array $return, string $search): array { return $return; } $user = $this->userSession->getUser(); + if (empty($user->getEMailAddress())) { + return $return; + } if (!str_contains($user->getEMailAddress(), $search) && !str_contains($user->getDisplayName(), $search)) { return $return; }