fix(接口定义): 空指针问题修复

This commit is contained in:
fit2-zhao 2021-03-12 18:12:29 +08:00
parent 7093a8a921
commit 170d811c14
1 changed files with 1 additions and 1 deletions

View File

@ -198,7 +198,7 @@ public class ApiDefinitionService {
.andProtocolEqualTo(request.getProtocol()).andPathEqualTo(request.getPath())
.andProjectIdEqualTo(request.getProjectId()).andIdNotEqualTo(request.getId());
Project project = projectMapper.selectByPrimaryKey(request.getProjectId());
if (apiDefinitionMapper.countByExample(example) > 0 && (project.getRepeatable() == null || !project.getRepeatable())) {
if (apiDefinitionMapper.countByExample(example) > 0 && (project == null || project.getRepeatable() == null || !project.getRepeatable())) {
MSException.throwException(Translator.get("api_definition_url_not_repeating"));
}
} else {