Fix NPE on removing a user
Bug: 12957232 Check for null mDeviceOwner. Change-Id: I107dc24d1a8de121ebd2c1bb56e1af40bb1c55ac
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
mDeviceOwner.removeProfileOwner(userHandle);
|
||||
mDeviceOwner.writeOwnerFile();
|
||||
if (mDeviceOwner != null) {
|
||||
mDeviceOwner.removeProfileOwner(userHandle);
|
||||
mDeviceOwner.writeOwnerFile();
|
||||
}
|
||||
|
||||
DevicePolicyData policy = mUserData.get(userHandle);
|
||||
if (policy != null) {
|
||||
|
||||
Reference in New Issue
Block a user