From c8dba03e71ef546dc65f6e858ba567863c6ea578 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 13 May 2018 21:37:43 +0200 Subject: [PATCH] avoid creating Account object with empty name or type --- .../com/simplemobiletools/contacts/helpers/ContactsHelper.kt | 4 +++- 1 file changed, 3 insertions(+), 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 722ed3af..8d5e4d40 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt @@ -698,7 +698,9 @@ class ContactsHelper(val activity: Activity) { } } - val contentResolverAccounts = getContentResolverAccounts().filter { !accounts.contains(Account(it.name, it.type)) } + val contentResolverAccounts = getContentResolverAccounts().filter { + it.name.isNotEmpty() && it.type.isNotEmpty() && !accounts.contains(Account(it.name, it.type)) + } sources.addAll(contentResolverAccounts) if (sources.isEmpty() && activity.config.localAccountName.isEmpty() && activity.config.localAccountType.isEmpty()) {