From 99c4780af786f581f5f222e1a922d5e86eed837c 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 5f65ee38c..3926a9c41 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; }