packages/apps/Settings
Revisão | 9b525443dce74b14460fca0b5e747d7ec0c73773 (tree) |
---|---|
Hora | 2016-10-08 21:27:25 |
Autor | Michael W <baddaemon87@gmai...> |
Commiter | Steve Kondik |
Settings: Fix possible NPE
mPackageInfo and applicationInfo can sometimes be null, causing an NPE.
Check for null first and make the menu entry invisible in that case.
This commit is a squash of the following commit from CM 13.0:
29d679a18784e8c28d2146ad3037c420abc00928 Settings: Fix possible crash
4b03da7757caf8a0dff2864ab6a2fac3afd91e39 Settings: Fix possible NPE
Change-Id: I4c2d73cced26b8900c95ede08e5a9c478c107529
Reference: BugDumps 13-20160715-21 L#52, BugDumps 20160909-15 L#39
@@ -475,7 +475,8 @@ public class InstalledAppDetails extends AppInfoBase | ||
475 | 475 | uninstallUpdatesItem, mAppsControlDisallowedAdmin); |
476 | 476 | } |
477 | 477 | |
478 | - menu.findItem(OPEN_PROTECTED_APPS).setVisible(mPackageInfo.applicationInfo.protect); | |
478 | + menu.findItem(OPEN_PROTECTED_APPS).setVisible(mPackageInfo != null && | |
479 | + mPackageInfo.applicationInfo != null && mPackageInfo.applicationInfo.protect); | |
479 | 480 | } |
480 | 481 | |
481 | 482 | @Override |