Commit dffdd471d5731c39906e0e65d381faef1c5f47f5
1 parent
6c193f72
member: 修正 查询用户列表方法,传入的ID集合为空时,会导致异常的问题
Showing
1 changed file
with
5 additions
and
0 deletions
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java
| 1 | 1 | package cn.iocoder.yudao.module.member.service.user; |
| 2 | 2 | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import cn.hutool.core.collection.ListUtil; | |
| 3 | 5 | import cn.hutool.core.util.IdUtil; |
| 4 | 6 | import cn.hutool.core.util.ObjectUtil; |
| 5 | 7 | import cn.hutool.core.util.StrUtil; |
| ... | ... | @@ -103,6 +105,9 @@ public class MemberUserServiceImpl implements MemberUserService { |
| 103 | 105 | |
| 104 | 106 | @Override |
| 105 | 107 | public List<MemberUserDO> getUserList(Collection<Long> ids) { |
| 108 | + if (CollUtil.isEmpty(ids)) { | |
| 109 | + return ListUtil.empty(); | |
| 110 | + } | |
| 106 | 111 | return memberUserMapper.selectBatchIds(ids); |
| 107 | 112 | } |
| 108 | 113 | ... | ... |