From 12c41b450cc33d9eb4002cba01550ff59e61e348 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 25 Dec 2018 09:58:22 +0000 Subject: [PATCH] Contact import: Don't list accounts with an empty account name or type. --- .../ui/importlocal/LocalContactImportFragment.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalContactImportFragment.java b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalContactImportFragment.java index b648edc5..ae15d399 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalContactImportFragment.java +++ b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalContactImportFragment.java @@ -102,9 +102,11 @@ public class LocalContactImportFragment extends Fragment { while (cursor.moveToNext()) { String accountName = cursor.getString(accountNameIndex); String accountType = cursor.getString(accountTypeIndex); - if (account == null || (!account.name.equals(accountName) || !account.type.equals(accountType))) { - account = new Account(accountName, accountType); - localAddressBooks.add(new LocalAddressBook(getContext(), account, provider)); + if (account == null || !(account.name.equals(accountName) && account.type.equals(accountType))) { + if ((accountName != null) && (accountType != null)) { + account = new Account(accountName, accountType); + localAddressBooks.add(new LocalAddressBook(getContext(), account, provider)); + } } }