diff options
author | Amith Yamasani <yamasani@google.com> | 2011-07-15 18:37:16 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2011-07-17 11:30:28 -0700 |
commit | 07d6fd2c0111c64d4a6721fd2a5a1fbe5102ff0b (patch) | |
tree | 9f107b161488164c62e13c0a462427d43b249810 /src | |
parent | e686c4dec63dd2d6c49caa35d7a985de27a6e031 (diff) | |
download | packages_apps_settings-07d6fd2c0111c64d4a6721fd2a5a1fbe5102ff0b.zip packages_apps_settings-07d6fd2c0111c64d4a6721fd2a5a1fbe5102ff0b.tar.gz packages_apps_settings-07d6fd2c0111c64d4a6721fd2a5a1fbe5102ff0b.tar.bz2 |
Fix NPE in MasterClear
Bug: 5008299
Change-Id: If2d02af7ecda7fe40445a3ec8e023138c5523fd6
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, |