Skip to content

Commit c8dba03

Browse files
committed
avoid creating Account object with empty name or type
1 parent c0ad866 commit c8dba03

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,9 @@ class ContactsHelper(val activity: Activity) {
698698
}
699699
}
700700

701-
val contentResolverAccounts = getContentResolverAccounts().filter { !accounts.contains(Account(it.name, it.type)) }
701+
val contentResolverAccounts = getContentResolverAccounts().filter {
702+
it.name.isNotEmpty() && it.type.isNotEmpty() && !accounts.contains(Account(it.name, it.type))
703+
}
702704
sources.addAll(contentResolverAccounts)
703705

704706
if (sources.isEmpty() && activity.config.localAccountName.isEmpty() && activity.config.localAccountType.isEmpty()) {

0 commit comments

Comments
 (0)