From 0342035b27bdc6a6de295e90f53f8f249ff741b3 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 25 Aug 2019 22:34:30 +0200 Subject: [PATCH] handle null names at importing gracefully --- .../com/simplemobiletools/contacts/pro/helpers/VcfImporter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/VcfImporter.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/VcfImporter.kt index 290327c1..9a959764 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/VcfImporter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/VcfImporter.kt @@ -135,7 +135,7 @@ class VcfImporter(val activity: SimpleActivity) { targetContactSource, starred, contactId, thumbnailUri, photo, notes, groups, organization, websites, IMs) // if there is no N and ORG fields at the given contact, only FN, treat it as an organization - if (contact.getNameToDisplay().isEmpty() && contact.organization.isEmpty() && ezContact.formattedName.value.isNotEmpty()) { + if (contact.getNameToDisplay().isEmpty() && contact.organization.isEmpty() && ezContact.formattedName?.value?.isNotEmpty() == true) { contact.organization.company = ezContact.formattedName.value }