From c19f66e75e52bced37ce126b21181cd2db496225 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 11 May 2021 11:11:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20swagger=E5=AF=BC=E5=85=A5=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/api/dto/definition/parse/Swagger3Parser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger3Parser.java b/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger3Parser.java index 2a907e269d..46cda3a3ff 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger3Parser.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger3Parser.java @@ -306,7 +306,9 @@ public class Swagger3Parser extends SwaggerAbstractParser { kv.setType("file"); } } - body.getKvs().add(kv); + if (body != null) { + body.getKvs().add(kv); + } } }