修复新增租户后,租户管理员更改资料报错异常,前台传入岗位参数为null时会出现本错误,后台增加为空时创建空集合,避免空指针异常 #I8910U : https://gitee.com/zhijiantianya/yudao-cloud/issues/I8910U

pull/66/head
huqingchun 2023-11-25 09:37:04 +08:00
parent 522ab17902
commit 3d5da3e3ff
1 changed files with 3 additions and 0 deletions

View File

@ -118,6 +118,9 @@ public class AdminUserServiceImpl implements AdminUserService {
Set<Long> dbPostIds = convertSet(userPostMapper.selectListByUserId(userId), UserPostDO::getPostId);
// 计算新增和删除的岗位编号
Set<Long> postIds = updateObj.getPostIds();
if (postIds==null) {
postIds = new LinkedHashSet<>();
}
Collection<Long> createPostIds = CollUtil.subtract(postIds, dbPostIds);
Collection<Long> deletePostIds = CollUtil.subtract(dbPostIds, postIds);
// 执行新增和删除。对于已经授权的菜单,不用做任何处理