Skip to content

Commit

Permalink
Merge pull request #12678 from SORMAS-Foundation/#9905-make_sync_work…
Browse files Browse the repository at this point in the history
…_for_users_without_role

#9905- make sync work for users without role
  • Loading branch information
sergiupacurariu authored Oct 23, 2023
2 parents 4d67791 + 81010fa commit a776b1a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected void fillInnerFromDto(User target, UserDto source) {
target.setLastName(source.getLastName());
target.setUserEmail(source.getUserEmail());

if (source.getUserRoles().size() > 0) {
if (source.getUserRoles() != null && source.getUserRoles().size() > 0) {
Set<UserRole> userRoles = Optional.of(target).map(User::getUserRoles).orElseGet(HashSet::new);
target.setUserRoles(userRoles);
userRoles.clear();
Expand All @@ -116,7 +116,7 @@ protected void fillInnerFromDto(User target, UserDto source) {
target.setPhone(source.getPhone());
target.setLanguage(source.getLanguage());

target.setJurisdictionLevel(DatabaseHelper.getUserDao().getJurisdictionLevel(target.getUserRoles()));
target.setJurisdictionLevel(source.getJurisdictionLevel());
}

@Override
Expand Down

0 comments on commit a776b1a

Please sign in to comment.