{"record":{"id":"42255395643994d4","repo":"paascloud/paascloud-master","slug":"uac10011001-422553","errorCode":"UAC10011001","errorMessage":"ErrorCodeEnum.UAC10011001","messagePattern":"ErrorCodeEnum\\.UAC10011001","errorType":"error_code","errorClass":"UacBizException","httpStatus":null,"severity":"warning","filePath":"paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacUserServiceImpl.java","lineNumber":254,"sourceCode":"\t\t\t\tgroupUser.setGroupId(user.getGroupId());\n\t\t\t\tgroupUser.setUserId(user.getId());\n\t\t\t\tuacGroupUserService.save(groupUser);\n\t\t\t} else {\n\t\t\t\t//修改组织\n\t\t\t\tUacGroupUser groupUser = new UacGroupUser();\n\t\t\t\tgroupUser.setUserId(user.getId());\n\t\t\t\tgroupUser.setGroupId(user.getGroupId());\n\t\t\t\tuacGroupUserService.updateByUserId(groupUser);\n\t\t\t}\n\t\t}\n\n\t}\n\n\t@Override\n\t@Transactional(readOnly = true, rollbackFor = Exception.class)\n\tpublic List<UacLog> queryUserLogListWithUserId(Long userId) {\n\t\tif (PublicUtil.isEmpty(userId)) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011001);\n\t\t}\n\t\treturn uacLogService.selectUserLogListByUserId(userId);\n\t}\n\n\t@Override\n\tpublic int modifyUserStatusById(UacUser uacUser, LoginAuthDto authResDto) {\n\t\tLong loginUserId = authResDto.getUserId();\n\t\tLong userId = uacUser.getId();\n\t\tif (loginUserId.equals(userId)) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011023);\n\t\t}\n\t\tUacUser u = uacUserMapper.selectByPrimaryKey(userId);\n\t\tif (u == null) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011011, userId);\n\t\t}\n\n\t\t// 更新用户最后修改人与修改时间\n\t\tuacUser.setVersion(u.getVersion() + 1);","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacUserServiceImpl.java#L236-L272","documentation":"UacBizException with ErrorCodeEnum.UAC10011001 (\"用户Id不能为空\") is thrown by UacUserServiceImpl.queryUserLogListWithUserId when the userId argument is null or empty. The user id is mandatory to look up audit logs, so a null id is rejected before querying.","triggerScenarios":"Calling queryUserLogListWithUserId(null), or passing a DTO/path variable that failed to bind (missing userId parameter in the controller request).","commonSituations":"Frontend omits userId in the query string; a profile/audit page renders before the user object is loaded; deserialization of a JSON body without the id field yields a null Long.","solutions":["Ensure the caller always passes a non-null userId; validate in the controller with @NotNull before invoking the service","Check request binding: the endpoint must include userId as a path variable or query param","Guard the calling code: skip the log lookup when the user object hasn't been loaded yet"],"exampleFix":"// before\nList<UacLog> logs = uacUserService.queryUserLogListWithUserId(userDto.getId());\n// after\nif (userDto == null || userDto.getId() == null) {\n    throw new IllegalArgumentException(\"userId is required\");\n}\nList<UacLog> logs = uacUserService.queryUserLogListWithUserId(userDto.getId());","handlingStrategy":"validation","validationCode":"if (userId == null) {\n    throw new IllegalArgumentException(\"userId is required\");\n}","typeGuard":"if (userId != null && userId > 0) {\n    List<UacLog> logs = uacUserService.queryUserLogListWithUserId(userId);\n}","tryCatchPattern":"try {\n    return uacUserService.queryUserLogListWithUserId(userId);\n} catch (UacBizException e) {\n    if (e.getCode() == 10011001) { return Collections.emptyList(); }\n    throw e;\n}","preventionTips":["Annotate controller params with @NotNull and validate early","Never render audit pages before the user object is loaded"],"tags":["null-argument","user-management","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"781281a9503332ed3cef44ea618349d14230a127","analyzedAt":"2026-09-10T10:59:02.070Z","contentChangedAt":"2026-09-10T10:59:02.070Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}