From c59116249050de7496d111d8c74b413c8c1a39ef Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Wed, 24 Jul 2024 16:39:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20id?= =?UTF-8?q?ea=E6=8F=92=E4=BB=B6=E5=AF=BC=E5=85=A5=E7=9A=84=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3,json-schema=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/metersphere/api/utils/JsonSchemaBuilder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/utils/JsonSchemaBuilder.java b/backend/services/api-test/src/main/java/io/metersphere/api/utils/JsonSchemaBuilder.java index c61b687275..eace0bf8c4 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/utils/JsonSchemaBuilder.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/utils/JsonSchemaBuilder.java @@ -265,7 +265,8 @@ public class JsonSchemaBuilder { } private static String getPropertyTextValue(JsonNode propertyNode, String key) { - return propertyNode.get(key) == null ? StringUtils.EMPTY : propertyNode.get(key).asText(); + JsonNode jsonNode = propertyNode.get(key); + return jsonNode == null || jsonNode instanceof NullNode ? StringUtils.EMPTY : jsonNode.asText(); } private static boolean isVariable(String value) {