Merge "Fixed NPE in canAddMoreManagedProfiles"

This commit is contained in:
Treehugger Robot
2017-01-19 18:53:24 +00:00
committed by Gerrit Code Review

View File

@@ -1443,7 +1443,7 @@ public class UserManagerService extends IUserManager.Stub {
}
synchronized(mUsersLock) {
UserInfo userInfo = getUserInfoLU(userId);
if (!userInfo.canHaveProfile()) {
if (userInfo == null || !userInfo.canHaveProfile()) {
return false;
}
int usersCountAfterRemoving = getAliveUsersExcludingGuestsCountLU()