From 92d7a701b55ae86247dd46e586a5cd1243937005 Mon Sep 17 00:00:00 2001 From: caiti Date: Tue, 17 May 2022 22:00:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BD=BF=E7=94=A8CollUtil.isEmpty?= =?UTF-8?q?=E5=88=A4=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/system/service/permission/PermissionServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);