mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
fix a crash at clicking on a contact without phone numbers
This commit is contained in:
@@ -144,7 +144,9 @@ class FavoritesFragment(context: Context, attributeSet: AttributeSet) : MyViewPa
|
||||
|
||||
private fun callContact(simpleContact: Contact) {
|
||||
val phoneNumbers = simpleContact.phoneNumbers
|
||||
if (phoneNumbers.size <= 1) {
|
||||
if (phoneNumbers.isEmpty()) {
|
||||
return
|
||||
} else if (phoneNumbers.size <= 1) {
|
||||
activity?.launchCallIntent(phoneNumbers.first().normalizedNumber)
|
||||
} else {
|
||||
val primaryNumber = simpleContact.phoneNumbers.find { it.isPrimary }
|
||||
|
Reference in New Issue
Block a user