fix(接口自动化): 修复执行类型为空时错误
This commit is contained in:
parent
3f80c98d76
commit
d3cd2f4843
|
@ -181,11 +181,13 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
|||
}
|
||||
// 请求体
|
||||
if (!StringUtils.equals(this.getMethod(), "GET")) {
|
||||
List<KeyValue> bodyParams = this.body.getBodyParams(sampler, this.getId());
|
||||
if (this.body.getType().equals("Form Data")) {
|
||||
sampler.setDoMultipart(true);
|
||||
if (this.body != null) {
|
||||
List<KeyValue> bodyParams = this.body.getBodyParams(sampler, this.getId());
|
||||
if (StringUtils.isNotEmpty(this.body.getType()) && this.body.getType().equals("Form Data")) {
|
||||
sampler.setDoMultipart(true);
|
||||
}
|
||||
sampler.setArguments(httpArguments(bodyParams));
|
||||
}
|
||||
sampler.setArguments(httpArguments(bodyParams));
|
||||
}
|
||||
|
||||
final HashTree httpSamplerTree = tree.add(sampler);
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
computed: {
|
||||
error() {
|
||||
return this.response.responseCode >= 400;
|
||||
return this.response && this.response.responseCode && this.response.responseCode >= 400;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
</div>
|
||||
<div class="ms-div">
|
||||
Body :
|
||||
<pre>{{response.body}}</pre>
|
||||
<pre>{{response.body ? response.body:""}}</pre>
|
||||
</div>
|
||||
|
||||
</el-tab-pane>
|
||||
|
|
Loading…
Reference in New Issue