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

Commit 9348ac82 authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Fix NPE on removing a user

Bug: 12957232

Check for null mDeviceOwner.

Change-Id: I107dc24d1a8de121ebd2c1bb56e1af40bb1c55ac
parent 976ed212
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -599,9 +599,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                Slog.w(LOG_TAG, "Tried to remove device policy file for user 0! Ignoring.");
                return;
            }

            if (mDeviceOwner != null) {
                mDeviceOwner.removeProfileOwner(userHandle);
                mDeviceOwner.writeOwnerFile();
            }

            DevicePolicyData policy = mUserData.get(userHandle);
            if (policy != null) {