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,7 +119,9 @@ public class UserController { | ||
| 119 | @PreAuthorize("@ss.hasPermission('system:user:query')") | 119 | @PreAuthorize("@ss.hasPermission('system:user:query')") |
| 120 | public CommonResult<UserRespVO> getUser(@RequestParam("id") Long id) { | 120 | public CommonResult<UserRespVO> getUser(@RequestParam("id") Long id) { |
| 121 | AdminUserDO user = userService.getUser(id); | 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 | DeptDO dept = deptService.getDept(user.getDeptId()); | 126 | DeptDO dept = deptService.getDept(user.getDeptId()); |
| 125 | return success(UserConvert.INSTANCE.convert(user, dept)); | 127 | return success(UserConvert.INSTANCE.convert(user, dept)); |