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); + } } }