fix: postman 导入GET请求报错

This commit is contained in:
chenjianxing 2020-07-21 19:16:52 +08:00
parent cc7c5b9e23
commit 43f9f190f7
1 changed files with 3 additions and 0 deletions

View File

@ -80,6 +80,9 @@ public class PostmanParser extends ApiImportAbstractParser {
private Body parseBody(PostmanRequest requestDesc, Request request) { private Body parseBody(PostmanRequest requestDesc, Request request) {
Body body = new Body(); Body body = new Body();
JSONObject postmanBody = requestDesc.getBody(); JSONObject postmanBody = requestDesc.getBody();
if (postmanBody == null) {
return null;
}
String bodyMode = postmanBody.getString("mode"); String bodyMode = postmanBody.getString("mode");
if (StringUtils.equals(bodyMode, PostmanRequestBodyMode.RAW.value())) { if (StringUtils.equals(bodyMode, PostmanRequestBodyMode.RAW.value())) {
body.setRaw(postmanBody.getString(bodyMode)); body.setRaw(postmanBody.getString(bodyMode));