mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-26 00:45:08 +08:00
fix: 使用CollUtil.isEmpty判空
This commit is contained in:
@ -250,7 +250,7 @@ public class PermissionServiceImpl implements PermissionService {
|
|||||||
public Set<Long> getUserRoleIdsFromCache(Long userId, Collection<Integer> roleStatuses) {
|
public Set<Long> getUserRoleIdsFromCache(Long userId, Collection<Integer> roleStatuses) {
|
||||||
Set<Long> cacheRoleIds = userRoleCache.get(userId);
|
Set<Long> cacheRoleIds = userRoleCache.get(userId);
|
||||||
// 创建用户的时候没有分配角色,会存在空指针异常
|
// 创建用户的时候没有分配角色,会存在空指针异常
|
||||||
if (cacheRoleIds == null || cacheRoleIds.isEmpty()) {
|
if (CollUtil.isEmpty(cacheRoleIds)) {
|
||||||
return Collections.emptySet();
|
return Collections.emptySet();
|
||||||
}
|
}
|
||||||
Set<Long> roleIds = new HashSet<>(cacheRoleIds);
|
Set<Long> roleIds = new HashSet<>(cacheRoleIds);
|
||||||
|
Reference in New Issue
Block a user