From 71d40b0e08dc7fe80343b3f66bd280b6149561d4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 23 Jan 2018 21:13:12 +0100 Subject: [PATCH] ignore phone number entries without a number --- .../com/simplemobiletools/contacts/helpers/ContactsHelper.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt index 5683bb0d..9687776f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt @@ -106,14 +106,15 @@ class ContactsHelper(val activity: BaseSimpleActivity) { if (cursor?.moveToFirst() == true) { do { val id = cursor.getIntValue(ContactsContract.Data.RAW_CONTACT_ID) - val number = cursor.getStringValue(CommonDataKinds.Phone.NUMBER) + val number = cursor.getStringValue(CommonDataKinds.Phone.NUMBER) ?: continue val type = cursor.getIntValue(CommonDataKinds.Phone.TYPE) if (phoneNumbers[id] == null) { phoneNumbers.put(id, ArrayList()) } - phoneNumbers[id].add(PhoneNumber(number, type)) + val phoneNumber = PhoneNumber(number, type) + phoneNumbers[id].add(phoneNumber) } while (cursor.moveToNext()) } } finally {