Skip to content

Commit

Permalink
fix npe
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzm0809 committed Jan 30, 2024
1 parent 0bd0ad1 commit 1db6530
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
* UserServiceImpl
Expand All @@ -83,6 +84,7 @@
*/
@Service
@RequiredArgsConstructor
@Slf4j
public class UserServiceImpl extends SuperServiceImpl<UserMapper, User> implements UserService {

private static final String DEFAULT_PASSWORD = "123456";
Expand Down Expand Up @@ -464,8 +466,14 @@ public List<User> getUserListByTenantId(int id) {
userTenantService.list(new LambdaQueryWrapper<UserTenant>().eq(UserTenant::getTenantId, id));
userTenants.forEach(userTenant -> {
User user = getById(userTenant.getUserId());
user.setTenantAdminFlag(userTenant.getTenantAdminFlag());
userList.add(user);
if (!Asserts.isNull(user)) {
user.setTenantAdminFlag(userTenant.getTenantAdminFlag());
userList.add(user);
} else {
log.error(
"Unable to obtain user information, the user may have been deleted, please contact the administrator to verify, userId:[{}]",
userTenant.getUserId());
}
});
return userList;
}
Expand Down

0 comments on commit 1db6530

Please sign in to comment.