diff --git a/backend/src/main/java/io/metersphere/api/mock/utils/MockApiUtils.java b/backend/src/main/java/io/metersphere/api/mock/utils/MockApiUtils.java index 4ee83af598..ac5d7c7848 100644 --- a/backend/src/main/java/io/metersphere/api/mock/utils/MockApiUtils.java +++ b/backend/src/main/java/io/metersphere/api/mock/utils/MockApiUtils.java @@ -709,11 +709,13 @@ public class MockApiUtils { } public static boolean checkParamsCompliance(JSONArray jsonArray, List mockConfigRequestParamList, boolean isAllMatch) { - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject obj = jsonArray.getJSONObject(i); - boolean isMatch = checkParamsCompliance(obj, mockConfigRequestParamList, isAllMatch); - if (isMatch) { - return true; + if (jsonArray != null) { + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject obj = jsonArray.getJSONObject(i); + boolean isMatch = checkParamsCompliance(obj, mockConfigRequestParamList, isAllMatch); + if (isMatch) { + return true; + } } } return false; diff --git a/frontend/src/business/components/common/json-schema/schema/editor/mock/MockComplete.vue b/frontend/src/business/components/common/json-schema/schema/editor/mock/MockComplete.vue index 56985704cc..369af43a39 100644 --- a/frontend/src/business/components/common/json-schema/schema/editor/mock/MockComplete.vue +++ b/frontend/src/business/components/common/json-schema/schema/editor/mock/MockComplete.vue @@ -10,7 +10,7 @@ value-key="name" highlight-first-item @select="change"> - +