diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java index 847450783..9c71e8bdb 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java +++ b/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 { public Set getUserRoleIdsFromCache(Long userId, Collection roleStatuses) { Set cacheRoleIds = userRoleCache.get(userId); // 创建用户的时候没有分配角色,会存在空指针异常 - if (cacheRoleIds == null || cacheRoleIds.isEmpty()) { + if (CollUtil.isEmpty(cacheRoleIds)) { return Collections.emptySet(); } Set roleIds = new HashSet<>(cacheRoleIds);