From ae35e0c013980439a20bf1c93a6aa88e8c9daaf9 Mon Sep 17 00:00:00 2001 From: Fabrice Di Meglio Date: Thu, 14 May 2015 14:20:45 -0700 Subject: [PATCH] Fix bug #21025020 Stability: JCs in Settings: Caused by: java.lang.NullPointerException - prevent the NPE Change-Id: Ief5a618e789e50eebcaa4386bd9ecec2192b4565 --- .../android/settings/applications/InstalledAppDetails.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java index 99d0172e2a..0cc046b0ae 100755 --- a/src/com/android/settings/applications/InstalledAppDetails.java +++ b/src/com/android/settings/applications/InstalledAppDetails.java @@ -283,12 +283,15 @@ public class InstalledAppDetails extends AppInfoBase mBatteryPreference.setOnPreferenceClickListener(this); mLaunchPreference = findPreference(KEY_LAUNCH); - if ((mAppEntry.info.flags&ApplicationInfo.FLAG_INSTALLED) == 0) { - mLaunchPreference.setEnabled(false); - } else if (!mAppEntry.info.enabled) { - mLaunchPreference.setEnabled(false); + if (mAppEntry.info != null) { + if ((mAppEntry.info.flags&ApplicationInfo.FLAG_INSTALLED) == 0 || + !mAppEntry.info.enabled) { + mLaunchPreference.setEnabled(false); + } else { + mLaunchPreference.setOnPreferenceClickListener(this); + } } else { - mLaunchPreference.setOnPreferenceClickListener(this); + mLaunchPreference.setEnabled(false); } } -- 2.11.0