From d59f2277ab4a4c6f6b69928daa38bfbc92dc11ab Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 23 Jan 2018 20:40:02 +0100 Subject: [PATCH] allow empty account name at contact fetching --- .../com/simplemobiletools/contacts/helpers/ContactsHelper.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 018d0e61..5683bb0d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt @@ -52,7 +52,7 @@ class ContactsHelper(val activity: BaseSimpleActivity) { val number = ArrayList() // proper value is obtained below val emails = ArrayList() val events = ArrayList() - val accountName = cursor.getStringValue(ContactsContract.RawContacts.ACCOUNT_NAME) + val accountName = cursor.getStringValue(ContactsContract.RawContacts.ACCOUNT_NAME) ?: "" val starred = cursor.getIntValue(CommonDataKinds.StructuredName.STARRED) val contactId = cursor.getIntValue(ContactsContract.Data.CONTACT_ID) val thumbnailUri = cursor.getStringValue(CommonDataKinds.StructuredName.PHOTO_THUMBNAIL_URI) ?: ""