Check for null results from getTypeForAccount.
bug: 63816624
Test: make Contacts and install. No crash.
Change-Id: Ic4f00413d196ff783d033740e0efb1c82c10e361
(cherry picked from commit d9ecda94ff66021247bde802757353b20ee6b7c8)
diff --git a/src/com/android/contacts/model/AccountTypeManager.java b/src/com/android/contacts/model/AccountTypeManager.java
index b442e4f..9938695 100644
--- a/src/com/android/contacts/model/AccountTypeManager.java
+++ b/src/com/android/contacts/model/AccountTypeManager.java
@@ -622,9 +622,10 @@
final AccountWithDataSet accountWithDataSet = new AccountWithDataSet(
account.name, account.type, null);
final AccountType type = mTypeProvider.getTypeForAccount(accountWithDataSet);
-
- // Accounts with a dataSet (e.g. Google plus accounts) are not writable.
- result.add(type.wrapAccount(mContext, accountWithDataSet));
+ if (type != null) {
+ // Accounts with a dataSet (e.g. Google plus accounts) are not writable.
+ result.add(type.wrapAccount(mContext, accountWithDataSet));
+ }
}
return result;
}