Unverified Commit 236a1909 authored by luoshangjie's avatar luoshangjie Committed by GitHub

[Fix][Admin] Fix the null pointer exception in the user list of the role (#3327)

parent 0eec1d43
......@@ -41,6 +41,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
......@@ -180,7 +181,12 @@ public class RoleServiceImpl extends SuperServiceImpl<RoleMapper, Role> implemen
List<User> userList = new ArrayList<>();
if (Asserts.isNotNull(userRoleList)) {
userRoleList.forEach(userRole -> userList.add(userService.getById(userRole.getUserId())));
userRoleList.forEach(userRole -> {
User user = userService.getById(userRole.getUserId());
if (Objects.nonNull(user)) {
userList.add(user);
}
});
}
return userList;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment