diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java index 74e804c3f0..e91d6758d4 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java @@ -187,7 +187,7 @@ public class MsHTTPSamplerProxy extends MsTestElement { } } else { String url = this.getUrl(); - if (!url.startsWith("http://") && !url.startsWith("https://")) { + if (StringUtils.isNotEmpty(url) && !url.startsWith("http://") && !url.startsWith("https://")) { url = "http://" + url; } if (StringUtils.isNotEmpty(this.getPort()) && this.getPort().startsWith("${")) {