summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/settings/accounts/AccountSyncSettings.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/settings/accounts/AccountSyncSettings.java b/src/com/android/settings/accounts/AccountSyncSettings.java
index 82f9844..4d9f80e 100644
--- a/src/com/android/settings/accounts/AccountSyncSettings.java
+++ b/src/com/android/settings/accounts/AccountSyncSettings.java
@@ -208,11 +208,13 @@ public class AccountSyncSettings extends AccountPreferenceBase {
new SyncStateCheckBoxPreference(getActivity(), account, authority);
item.setPersistent(false);
final ProviderInfo providerInfo = getPackageManager().resolveContentProvider(authority, 0);
- CharSequence providerLabel = providerInfo != null
- ? providerInfo.loadLabel(getPackageManager()) : null;
+ if (providerInfo == null) {
+ return;
+ }
+ CharSequence providerLabel = providerInfo.loadLabel(getPackageManager());
if (TextUtils.isEmpty(providerLabel)) {
Log.e(TAG, "Provider needs a label for authority '" + authority + "'");
- providerLabel = authority;
+ return;
}
String title = getString(R.string.sync_item_title, providerLabel);
item.setTitle(title);