NPE if trying to update user with no attributes

This commit is contained in:
Stian Thorgersen 2013-11-15 15:00:43 +00:00
parent 1262ab70c8
commit 9e73592381

View file

@ -67,8 +67,10 @@ public class UsersResource {
user.setEmail(rep.getEmail());
user.setFirstName(rep.getFirstName());
user.setLastName(rep.getLastName());
for (Map.Entry<String, String> attr : rep.getAttributes().entrySet()) {
user.setAttribute(attr.getKey(), attr.getValue());
if (rep.getAttributes() != null) {
for (Map.Entry<String, String> attr : rep.getAttributes().entrySet()) {
user.setAttribute(attr.getKey(), attr.getValue());
}
}
}