am ff8bcc1d: am 2cbec492: Merge "Make sure unmatched autenticator/account-types doesn\'t crash Contacts."
* commit 'ff8bcc1d4af9135107d287cc54a29cb00bacdc52':
Make sure unmatched autenticator/account-types doesn't crash Contacts.
diff --git a/src/com/android/contacts/model/Sources.java b/src/com/android/contacts/model/Sources.java
index be3f17d..06d7551 100644
--- a/src/com/android/contacts/model/Sources.java
+++ b/src/com/android/contacts/model/Sources.java
@@ -203,6 +203,10 @@
// adapter, using the authenticator to find general resources.
final String accountType = sync.accountType;
final AuthenticatorDescription auth = findAuthenticator(auths, accountType);
+ if (auth == null) {
+ Log.w(TAG, "No authenticator found for type=" + accountType + ", ignoring it.");
+ continue;
+ }
ContactsSource source;
if (GoogleSource.ACCOUNT_TYPE.equals(accountType)) {
@@ -239,7 +243,7 @@
return auth;
}
}
- throw new IllegalStateException("Couldn't find authenticator for specific account type");
+ return null;
}
/**