fix: 修改接口用例空指针

This commit is contained in:
chenjianxing 2021-01-18 17:07:12 +08:00
parent 7cb3d59d02
commit 51ca545122
2 changed files with 5 additions and 3 deletions

View File

@ -190,7 +190,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()) {
if (apiDefinitionMapper.countByExample(example) > 0 && (project.getRepeatable() == null || !project.getRepeatable())) {
MSException.throwException(Translator.get("api_definition_url_not_repeating"));
}
} else {

View File

@ -105,8 +105,10 @@
return;
}
if (this.response.headers.indexOf("Content-Type: application/json") > 0) {
this.$refs.modeDropdown.handleCommand(BODY_FORMAT.JSON);
this.msCodeReload();
if (this.$refs.modeDropdown) {
this.$refs.modeDropdown.handleCommand(BODY_FORMAT.JSON);
this.msCodeReload();
}
}
},
msCodeReload() {