diff --git a/backend/src/main/java/io/metersphere/excel/listener/TestCaseNoModelDataListener.java b/backend/src/main/java/io/metersphere/excel/listener/TestCaseNoModelDataListener.java index 43a17dd857..c6ce0e507e 100644 --- a/backend/src/main/java/io/metersphere/excel/listener/TestCaseNoModelDataListener.java +++ b/backend/src/main/java/io/metersphere/excel/listener/TestCaseNoModelDataListener.java @@ -196,7 +196,7 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener keyOrValues = JSONArray.parseArray(keyOrValuesStr, String.class); for (int i = 0; i < keyOrValues.size(); i++) { diff --git a/backend/src/main/java/io/metersphere/track/validate/CustomFieldMultipleSelectValidator.java b/backend/src/main/java/io/metersphere/track/validate/CustomFieldMultipleSelectValidator.java index 8eece8d939..5a04340f94 100644 --- a/backend/src/main/java/io/metersphere/track/validate/CustomFieldMultipleSelectValidator.java +++ b/backend/src/main/java/io/metersphere/track/validate/CustomFieldMultipleSelectValidator.java @@ -18,6 +18,7 @@ public class CustomFieldMultipleSelectValidator extends CustomFieldSelectValidat if (StringUtils.isBlank(value)) { return; } + prepareCatch(customField); Set idSet = optionValueSetCache.get(customField.getId()); Set textSet = optionTextSetCache.get(customField.getId()); for (String item : parse2Array(customField.getName(), value)) { @@ -29,6 +30,9 @@ public class CustomFieldMultipleSelectValidator extends CustomFieldSelectValidat @Override public String parse2Key(String keyOrValuesStr, CustomFieldDao customField) { + if (StringUtils.isBlank(keyOrValuesStr)) { + return ""; + } List keyOrValues = JSONArray.parseArray(keyOrValuesStr, String.class); Map nameMap = optionTextMapCache.get(customField.getId()); for (int i = 0; i < keyOrValues.size(); i++) { diff --git a/backend/src/main/java/io/metersphere/track/validate/CustomFieldSelectValidator.java b/backend/src/main/java/io/metersphere/track/validate/CustomFieldSelectValidator.java index eaf3978557..826aa6fdfa 100644 --- a/backend/src/main/java/io/metersphere/track/validate/CustomFieldSelectValidator.java +++ b/backend/src/main/java/io/metersphere/track/validate/CustomFieldSelectValidator.java @@ -68,7 +68,7 @@ public class CustomFieldSelectValidator extends AbstractCustomFieldValidator { * * @param customField */ - private void prepareCatch(CustomFieldDao customField) { + protected void prepareCatch(CustomFieldDao customField) { if (optionValueSetCache.get(customField.getId()) == null) { List options = getOptions(customField.getId(), customField.getOptions());