diff --git a/api-test/backend/src/main/java/io/metersphere/service/ShareInfoService.java b/api-test/backend/src/main/java/io/metersphere/service/ShareInfoService.java index f9c04b1161..b82c5b2cb2 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/ShareInfoService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/ShareInfoService.java @@ -218,7 +218,7 @@ public class ShareInfoService extends BaseShareInfoService { if (apiModel.getRequest() != null) { ObjectNode requestObj = this.genJSONObject(apiModel.getRequest()); if (requestObj != null) { - if (requestObj.has("headers")) { + if (requestObj.has("headers") && requestObj.get("headers").isArray()) { List requestHeadDataArr = new LinkedList<>(); //head赋值 ArrayNode headArr = requestObj.withArray("headers"); @@ -232,7 +232,7 @@ public class ShareInfoService extends BaseShareInfoService { } //url参数赋值 ArrayNode urlParamArr = JSONUtil.createArray(); - if (requestObj.has("arguments")) { + if (requestObj.has("arguments") && requestObj.get("arguments").isArray()) { try { ArrayNode headArr = requestObj.withArray("arguments"); for (int index = 0; index < headArr.size(); index++) { @@ -247,7 +247,7 @@ public class ShareInfoService extends BaseShareInfoService { } //rest参数设置 ArrayNode restParamArr = JSONUtil.createArray(); - if (requestObj.has("rest")) { + if (requestObj.has("rest") && requestObj.get("rest").isArray()) { try { //urlParam -- rest赋值 ArrayNode headArr = requestObj.withArray("rest");