Skip to content

Commit

Permalink
Cover edge case for empty email and phone number for multiple contact…
Browse files Browse the repository at this point in the history
… that have same display_name

Signed-off-by: alperozturk <alper_ozturk@proton.me>
  • Loading branch information
alperozturk96 committed Jul 16, 2024
1 parent 9cb2ca2 commit 9e88fb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/com/nextcloud/utils/ContactManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class ContactManager(private val context: Context) {
val phoneNumber = searchResult.phoneNumber()

contactIds.forEach {
val targetEmail = getEmailById(it)
val targetPhoneNumber = getPhoneNumberById(it)
val targetEmail = getEmailById(it) ?: ""
val targetPhoneNumber = getPhoneNumberById(it) ?: ""
if (targetEmail == email && targetPhoneNumber == phoneNumber) {
return it
}
Expand Down

0 comments on commit 9e88fb7

Please sign in to comment.