Commit 92d7a701b55ae86247dd46e586a5cd1243937005

Authored by caiti
1 parent 3eb2f344

fix: 使用CollUtil.isEmpty判空

yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java
... ... @@ -250,7 +250,7 @@ public class PermissionServiceImpl implements PermissionService {
250 250 public Set<Long> getUserRoleIdsFromCache(Long userId, Collection<Integer> roleStatuses) {
251 251 Set<Long> cacheRoleIds = userRoleCache.get(userId);
252 252 // 创建用户的时候没有分配角色,会存在空指针异常
253   - if (cacheRoleIds == null || cacheRoleIds.isEmpty()) {
  253 + if (CollUtil.isEmpty(cacheRoleIds)) {
254 254 return Collections.emptySet();
255 255 }
256 256 Set<Long> roleIds = new HashSet<>(cacheRoleIds);
... ...