mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fixing null pointer when roles are not specified on creating new user
This commit is contained in:
parent
9a0ba9137b
commit
704680d68d
@ -104,8 +104,11 @@ public class UserManagementServiceImpl implements UserManagementService {
|
||||
userInfo.getEmailAddress());
|
||||
// calling addUser method of carbon user api
|
||||
List<String> tmpRoles = new ArrayList<>();
|
||||
String[] userInfoRoles = userInfo.getRoles();
|
||||
tmpRoles.add(DEFAULT_DEVICE_USER);
|
||||
tmpRoles.addAll(Arrays.asList(userInfo.getRoles()));
|
||||
if (userInfoRoles != null) {
|
||||
tmpRoles.addAll(Arrays.asList(userInfoRoles));
|
||||
}
|
||||
String[] roles = new String[tmpRoles.size()];
|
||||
tmpRoles.toArray(roles);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user