fix: 场景下无请求是保存报错
This commit is contained in:
parent
4ec1f387a5
commit
9d8d77ef9a
|
@ -1056,7 +1056,7 @@ class JMXGenerator {
|
|||
|
||||
this.addScenarioCookieManager(threadGroup, scenario);
|
||||
// 放在计划或线程组中,不建议放具体某个请求中
|
||||
this.addDNSCacheManager(threadGroup, scenario.requests[0]);
|
||||
this.addDNSCacheManager(threadGroup, scenario);
|
||||
|
||||
this.addJDBCDataSources(threadGroup, scenario);
|
||||
|
||||
|
@ -1138,7 +1138,11 @@ class JMXGenerator {
|
|||
}
|
||||
}
|
||||
|
||||
addDNSCacheManager(threadGroup, request) {
|
||||
addDNSCacheManager(threadGroup, scenario) {
|
||||
if (scenario.requests.length < 1) {
|
||||
return
|
||||
}
|
||||
let request = scenario.requests[0];
|
||||
if (request.environment) {
|
||||
let commonConfig = request.environment.config.commonConfig;
|
||||
let hosts = commonConfig.hosts;
|
||||
|
|
Loading…
Reference in New Issue