1
0
mirror of https://github.com/etesync/android synced 2024-11-22 07:58:09 +00:00

Contact import: Don't list accounts with an empty account name or type.

This commit is contained in:
Tom Hacohen 2018-12-25 09:58:22 +00:00
parent 25759a4e86
commit 12c41b450c

View File

@ -102,9 +102,11 @@ public class LocalContactImportFragment extends Fragment {
while (cursor.moveToNext()) { while (cursor.moveToNext()) {
String accountName = cursor.getString(accountNameIndex); String accountName = cursor.getString(accountNameIndex);
String accountType = cursor.getString(accountTypeIndex); String accountType = cursor.getString(accountTypeIndex);
if (account == null || (!account.name.equals(accountName) || !account.type.equals(accountType))) { if (account == null || !(account.name.equals(accountName) && account.type.equals(accountType))) {
account = new Account(accountName, accountType); if ((accountName != null) && (accountType != null)) {
localAddressBooks.add(new LocalAddressBook(getContext(), account, provider)); account = new Account(accountName, accountType);
localAddressBooks.add(new LocalAddressBook(getContext(), account, provider));
}
} }
} }