Commit 40912536931d75395d38cc5f5a39290f1d6ecbb9
Committed by
Gitee
1 parent
d46097a6
获取不到用户引发的NPE异常
Signed-off-by: g_l <glwxx0719@163.com>
Showing
1 changed file
with
1 additions
and
0 deletions
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java
| ... | ... | @@ -119,6 +119,7 @@ public class UserController { |
| 119 | 119 | @PreAuthorize("@ss.hasPermission('system:user:query')") |
| 120 | 120 | public CommonResult<UserRespVO> getUser(@RequestParam("id") Long id) { |
| 121 | 121 | AdminUserDO user = userService.getUser(id); |
| 122 | + if (ObjectUtil.isEmpty(user)) return CommonResult.success(null); | |
| 122 | 123 | // 拼接数据 |
| 123 | 124 | DeptDO dept = deptService.getDept(user.getDeptId()); |
| 124 | 125 | return success(UserConvert.INSTANCE.convert(user, dept)); | ... | ... |