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

Commit fdcf7283 authored by Michael W's avatar Michael W Committed by Zhao Wei Liew
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
(cherry picked from commit 9b525443)
parent 8fd6ee9c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -559,7 +559,8 @@ public class InstalledAppDetails extends Fragment
        }
        menu.findItem(UNINSTALL_ALL_USERS_MENU).setVisible(showIt);

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

    @Override