{"record":{"id":"eb1c28e61459f4d9","repo":"paascloud/paascloud-master","slug":"uac10012001","errorCode":"UAC10012001","errorMessage":"UAC10012001","messagePattern":"UAC10012001","errorType":"error_code","errorClass":"UacBizException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacActionServiceImpl.java","lineNumber":122,"sourceCode":"\t\t\tint result = uacActionMapper.updateByPrimaryKeySelective(action);\n\t\t\tif (result < 1) {\n\t\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10014003);\n\t\t\t}\n\t\t}\n\t}\n\n\t@Override\n\tpublic int deleteByMenuId(Long id) {\n\t\tPreconditions.checkArgument(id != null, \"菜单ID不能为空\");\n\n\t\treturn uacActionMapper.deleteByMenuId(id);\n\t}\n\n\t@Override\n\t@Transactional(readOnly = true, rollbackFor = Exception.class)\n\tpublic List<Long> getCheckedActionList(Long roleId) {\n\t\tif (roleId == null) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10012001);\n\t\t}\n\t\treturn uacActionMapper.getCheckedActionList(roleId);\n\t}\n\n\t@Override\n\t@Transactional(readOnly = true, rollbackFor = Exception.class)\n\tpublic List<MenuVo> getOwnAuthList(Long userId) {\n\t\treturn uacActionMapper.getOwnAuthList(userId);\n\t}\n\n\t@Override\n\t@Transactional(readOnly = true, rollbackFor = Exception.class)\n\tpublic List<Long> getCheckedMenuList(Long roleId) {\n\t\tif (roleId == null) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10012001);\n\t\t}\n\t\treturn uacActionMapper.getCheckedMenuList(roleId);\n\t}","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacActionServiceImpl.java#L104-L140","documentation":"Fires in UacActionServiceImpl.getCheckedActionList when roleId is null. It is a plain null-sentinel guard thrown before the mapper query executes, indicating the caller asked for the actions checked under a role without supplying which role; caller must provide a valid non-null roleId.","triggerScenarios":"getCheckedActionList(null), typically when the role selection was not propagated from the UI or the LoginAuthDto/context lacked a role id.","commonSituations":"Role checkbox tree loaded before a role is selected; controller passes null path variable; frontend state not initialized.","solutions":["Always pass a valid roleId; require it at the controller layer","On the client, disable the action-tree request until a role is selected","Validate roleId != null before calling the service"],"exampleFix":"// before\nList<Long> ids = uacActionService.getCheckedActionList(roleDto.getId());\n// after\nPreconditions.checkNotNull(roleDto.getId(), \"roleId is required\");\nList<Long> ids = uacActionService.getCheckedActionList(roleDto.getId());","handlingStrategy":"validation","validationCode":"if (roleId == null) { return Collections.emptyList(); }","typeGuard":"null","tryCatchPattern":"try { return service.getCheckedActionList(roleId); } catch (UacBizException e) { return Collections.emptyList(); }","preventionTips":["Only load checked lists after a role is selected","Make roleId a required controller parameter","Add unit tests covering null roleId"],"tags":["null-argument","role","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-16T04:17:20.429Z"}