Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af0d1ba5 authored by Michael W's avatar Michael W Committed by Arne Coucheron
Browse files

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:
29d679a1 Settings: Fix possible crash
4b03da77 Settings: Fix possible NPE

Change-Id: I4c2d73cced26b8900c95ede08e5a9c478c107529
Reference: BugDumps 13-20160715-21 L#52, BugDumps 20160909-15 L#39
parent b07375b1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -479,7 +479,8 @@ public class InstalledAppDetails extends AppInfoBase
                    uninstallUpdatesItem, mAppsControlDisallowedAdmin);
        }

        menu.findItem(OPEN_PROTECTED_APPS).setVisible(mPackageInfo.applicationInfo.protect);
        menu.findItem(OPEN_PROTECTED_APPS).setVisible(mPackageInfo != null &&
                mPackageInfo.applicationInfo != null && mPackageInfo.applicationInfo.protect);
    }

    @Override