diff options
author | Amith Yamasani <yamasani@google.com> | 2011-07-17 12:36:39 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-17 12:36:39 -0700 |
commit | 7f4db239592d852267845ecd54aaafe38124226c (patch) | |
tree | 3b9adfe27fc391f52000d3de1b23aa3e7f1c0fc9 /src | |
parent | abc95ee82295b82ad0475a8b4c55a5196a5f014a (diff) | |
parent | 07d6fd2c0111c64d4a6721fd2a5a1fbe5102ff0b (diff) | |
download | packages_apps_settings-7f4db239592d852267845ecd54aaafe38124226c.zip packages_apps_settings-7f4db239592d852267845ecd54aaafe38124226c.tar.gz packages_apps_settings-7f4db239592d852267845ecd54aaafe38124226c.tar.bz2 |
Merge "Fix NPE in MasterClear"
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/MasterClear.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/settings/MasterClear.java b/src/com/android/settings/MasterClear.java index 1b045ea..29a92b1 100644 --- a/src/com/android/settings/MasterClear.java +++ b/src/com/android/settings/MasterClear.java @@ -196,13 +196,14 @@ public class MasterClear extends Fragment { + " type=" + account.type); continue; } - Drawable icon; + Drawable icon = null; try { - Context authContext = context.createPackageContext(desc.packageName, 0); - icon = authContext.getResources().getDrawable(desc.iconId); + if (desc.iconId != 0) { + Context authContext = context.createPackageContext(desc.packageName, 0); + icon = authContext.getResources().getDrawable(desc.iconId); + } } catch (PackageManager.NameNotFoundException e) { Log.w(TAG, "No icon for account type " + desc.type); - icon = null; } TextView child = (TextView)inflater.inflate(R.layout.master_clear_account, |