{"record":{"id":"d03402bb3805b2a4","repo":"paascloud/paascloud-master","slug":"id-d03402","errorCode":null,"errorMessage":"权限ID不能为空","messagePattern":"权限ID不能为空","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacActionServiceImpl.java","lineNumber":66,"sourceCode":"\t\tList<Long> menuIdList = actionMainQueryDto.getMenuIdList();\n\t\tLong menuId = null;\n\t\tif (PublicUtil.isNotEmpty(menuIdList)) {\n\t\t\tmenuId = menuIdList.get(menuIdList.size() - 1);\n\t\t}\n\t\tUacAction uacAction = new UacAction();\n\t\tuacAction.setMenuId(menuId);\n\t\tBeanUtils.copyProperties(actionMainQueryDto, uacAction);\n\t\tuacAction.setOrderBy(\"update_time desc\");\n\t\tPageHelper.startPage(actionMainQueryDto.getPageNum(), actionMainQueryDto.getPageSize());\n\t\tList<ActionVo> actionList = uacActionMapper.queryActionListWithPage(uacAction);\n\t\treturn new PageInfo<>(actionList);\n\t}\n\n\t@Override\n\tpublic int deleteActionById(Long actionId) {\n\t\t//查询该角色下是否有用户绑定, 有的话提醒不能删除\n\t\tif (null == actionId) {\n\t\t\tthrow new IllegalArgumentException(\"权限ID不能为空\");\n\t\t}\n\n\t\tUacAction uacAction = uacActionMapper.selectByPrimaryKey(actionId);\n\t\tif (uacAction == null) {\n\t\t\tlogger.error(\"找不到权限信息 actionId={}\", actionId);\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10014001, actionId);\n\t\t}\n\n\t\t// 删除角色权限表数据  不查询了 直接删除了\n\t\tuacRoleActionMapper.deleteByActionId(actionId);\n\n\t\treturn uacActionMapper.deleteByPrimaryKey(actionId);\n\t}\n\n\t@Override\n\tpublic void batchDeleteByIdList(List<Long> deleteIdList) {\n\t\tlogger.info(\"批量删除角色. deleteIdList={}\", deleteIdList);\n\t\tPreconditions.checkArgument(PublicUtil.isNotEmpty(deleteIdList), \"删除权限ID不能为空\");","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacActionServiceImpl.java#L48-L84","documentation":"deleteActionById throws IllegalArgumentException('权限ID不能为空' — 'permission ID cannot be empty') when actionId is null. It is a plain JDK guard, not a business exception, protecting the subsequent mapper lookups from a null primary key.","triggerScenarios":"Calling uacActionService.deleteActionById(null), e.g. when the caller's request body or path variable for the action id was never populated.","commonSituations":"Front-end sends a delete request without the id; controller binding fails silently; batch UI passes null entries.","solutions":["Ensure the caller supplies a non-null actionId before invoking the service","Validate/require the id at the controller layer (@NotNull / @RequestParam mandatory)","Check request JSON field name matches the DTO property"],"exampleFix":"// before\nuacActionService.deleteActionById(request.getId());\n// after\nif (request.getId() == null) {\n    throw new UacBizException(ErrorCodeEnum.UAC10014001, -1L);\n}\nuacActionService.deleteActionById(request.getId());","handlingStrategy":"validation","validationCode":"if (actionId == null) { throw new IllegalArgumentException(\"actionId must not be null\"); }","typeGuard":"null","tryCatchPattern":"try { service.deleteActionById(id); } catch (IllegalArgumentException e) { logger.warn(\"missing action id\"); return 0; }","preventionTips":["Require the id at the API boundary (@NotNull)","Check request binding logs when ids come back null","Never construct delete calls from optional fields without checks"],"tags":["null-argument","validation","java"],"backgroundTag":"null-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"}