From 5c83c7136ec66bafa6e79be0fdd8d3b310c16485 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 9 Oct 2020 10:41:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=B2=A1=E6=9C=89=E8=BF=94=E5=9B=9E=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E6=97=B6=E6=8F=90=E5=8F=96=E5=8F=98=E9=87=8F=E4=BF=9D?= =?UTF-8?q?=E6=8A=A4=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/io/metersphere/api/jmeter/JMeterVars.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/jmeter/JMeterVars.java b/backend/src/main/java/io/metersphere/api/jmeter/JMeterVars.java index 6bcd2150f7..91dfb1edac 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/JMeterVars.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/JMeterVars.java @@ -13,7 +13,8 @@ import java.util.*; public class JMeterVars { - private JMeterVars() { } + private JMeterVars() { + } // 数据和线程变量保持一致 private static Map variables = new HashMap<>(); @@ -24,7 +25,7 @@ public class JMeterVars { if (!StringUtils.isEmpty(extract) && vars != null) { List extracts = Arrays.asList(extract.split(";")); Optional.ofNullable(extracts).orElse(new ArrayList<>()).forEach(item -> { - vs.put(item, vars.get(item)); + vs.put(item, vars.get(item) == null ? "" : vars.get(item)); }); vs.remove("TESTSTART.MS"); // 标示变量移除 }