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

Commit 225b7e08 authored by Jonathan Scott's avatar Jonathan Scott Committed by Automerger Merge Worker
Browse files

Merge "Fix NPE when removing policies." into udc-dev am: f76eaf9a

parents 90210c01 f76eaf9a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1066,6 +1066,11 @@ final class DevicePolicyEngine {
     * Removes all local policies for the provided {@code userId}.
     */
    private void removeLocalPoliciesForUser(int userId) {
        if (!mLocalPolicies.contains(userId)) {
            // No policies on user
            return;
        }

        Set<PolicyKey> localPolicies = new HashSet<>(mLocalPolicies.get(userId).keySet());
        for (PolicyKey policy : localPolicies) {
            PolicyState<?> policyState = mLocalPolicies.get(userId).get(policy);