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

Commit e79c3733 authored by Jorge Ruesga's avatar Jorge Ruesga
Browse files

settings: ensure we don't call isProtectedApp with an invalid reference



isProtectedApp could be called from onPrepareOptionsMenu with an invalid mPackageInfo
reference. Just ensure the activity doesn't crash by return false (with an invalid
mPackageInfo reference the acitivty will be closed).

Change-Id: Ifa4754decefce726e6703d38744f6c5b7878437f
JIRA: NIGHTLIES-1949
Signed-off-by: default avatarJorge Ruesga <jorge@ruesga.com>
parent 5fcea94f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1568,7 +1568,8 @@ public class InstalledAppDetails extends Fragment
    private boolean isProtectedApp() {
        // Some system apps doesn't have applicationInfo. Ensure we don't access to a null
        // reference. In that case we assume the app isn't protected
        return mPackageInfo.applicationInfo != null && mPackageInfo.applicationInfo.protect;
        return mPackageInfo != null && mPackageInfo.applicationInfo != null
                && mPackageInfo.applicationInfo.protect;
    }
}