fix(全局前后置脚本): 修复全局前后置脚本为空时控制台报错的问题

修复全局前后置脚本为空时控制台报错的问题
This commit is contained in:
song-tianyang 2021-10-18 18:17:44 +08:00 committed by song-tianyang
parent 7ee6a77d76
commit 54e7241715
1 changed files with 2 additions and 2 deletions

View File

@ -73,7 +73,7 @@ public class MsThreadGroup extends MsTestElement {
} }
//检查全局前后置脚本 //检查全局前后置脚本
if (preProcessor != null) { if (preProcessor != null && StringUtils.isNotEmpty(preProcessor.getScript())) {
preProcessor.setType("JSR223Processor"); preProcessor.setType("JSR223Processor");
preProcessor.setName("PRE_PROCESSOR_ENV_"+preProcessor.isConnScenario()); preProcessor.setName("PRE_PROCESSOR_ENV_"+preProcessor.isConnScenario());
preProcessor.setClazzName("io.metersphere.api.dto.definition.request.processors.MsJSR223Processor"); preProcessor.setClazzName("io.metersphere.api.dto.definition.request.processors.MsJSR223Processor");
@ -83,7 +83,7 @@ public class MsThreadGroup extends MsTestElement {
el.toHashTree(groupTree, el.getHashTree(), config); el.toHashTree(groupTree, el.getHashTree(), config);
} }
if (postProcessor != null) { if (postProcessor != null && StringUtils.isNotEmpty(postProcessor.getScript())) {
postProcessor.setType("JSR223Processor"); postProcessor.setType("JSR223Processor");
postProcessor.setName("POST_PROCESSOR_ENV_"+preProcessor.isConnScenario()); postProcessor.setName("POST_PROCESSOR_ENV_"+preProcessor.isConnScenario());
postProcessor.setClazzName("io.metersphere.api.dto.definition.request.processors.MsJSR223Processor"); postProcessor.setClazzName("io.metersphere.api.dto.definition.request.processors.MsJSR223Processor");