Skip to content

Commit 610eb24

Browse files
committed
fix: prevent warning when haven't an email
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 889003c commit 610eb24

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/Controller/IdentifyAccountController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,13 @@ private function addHerselfAccount(array $return, string $search): array {
170170
return $return;
171171
}
172172
$user = $this->userSession->getUser();
173+
$search = strtolower($search);
173174
if (!str_contains($user->getUID(), $search)
174175
&& !str_contains(strtolower($user->getDisplayName()), $search)
175-
&& !str_contains($user->getEMailAddress(), $search)
176+
&& (
177+
$user->getEMailAddress() === null
178+
|| ($user->getEMailAddress() !== null && !str_contains($user->getEMailAddress(), $search))
179+
)
176180
) {
177181
return $return;
178182
}

0 commit comments

Comments
 (0)