avoid creating Account object with empty name or type
This commit is contained in:
parent
c0ad8662f4
commit
c8dba03e71
1 changed files with 3 additions and 1 deletions
|
|
@ -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)
|
sources.addAll(contentResolverAccounts)
|
||||||
|
|
||||||
if (sources.isEmpty() && activity.config.localAccountName.isEmpty() && activity.config.localAccountType.isEmpty()) {
|
if (sources.isEmpty() && activity.config.localAccountName.isEmpty() && activity.config.localAccountType.isEmpty()) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue