Fix bug #21025020 Stability: JCs in Settings: Caused by: java.lang.NullPointerException

- prevent the NPE

Change-Id: Ief5a618e789e50eebcaa4386bd9ecec2192b4565
This commit is contained in:
Fabrice Di Meglio
2015-05-14 14:20:45 -07:00
parent aeb09164cc
commit ae35e0c013

View File

@@ -283,13 +283,16 @@ 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) {
if (mAppEntry.info != null) {
if ((mAppEntry.info.flags&ApplicationInfo.FLAG_INSTALLED) == 0 ||
!mAppEntry.info.enabled) {
mLaunchPreference.setEnabled(false);
} else {
mLaunchPreference.setOnPreferenceClickListener(this);
}
} else {
mLaunchPreference.setEnabled(false);
}
}
private void handleHeader() {