Skip to content

Commit

Permalink
fix: prevent error when current user don't have an email
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Apr 2, 2024
1 parent 0ebe6e2 commit 04f3630
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Controller/IdentifyAccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 04f3630

Please sign in to comment.