Commit 4466eb1bcdec54bdccb29f683016969791b3fb06
1 parent
c1850994
【修复】SYSTEM:id 获取不到用户引发的 NPE 异常
Showing
1 changed file
with
3 additions
and
1 deletions
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java
| ... | ... | @@ -119,7 +119,9 @@ 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 | + if (user == null) { | |
| 123 | + return success(null); | |
| 124 | + } | |
| 123 | 125 | // 拼接数据 |
| 124 | 126 | DeptDO dept = deptService.getDept(user.getDeptId()); |
| 125 | 127 | return success(UserConvert.INSTANCE.convert(user, dept)); | ... | ... |