From 0fb8fb328a6cb74e7d1bfe70f3509b1ebeb1ecc2 Mon Sep 17 00:00:00 2001 From: Ole Lensmar Date: Thu, 1 Sep 2016 23:05:19 +0200 Subject: [PATCH] fixed NPE on missing model definitions in Swagger definition --- .../java/io/swagger/inflector/utils/VendorSpecFilter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/swagger/inflector/utils/VendorSpecFilter.java b/src/main/java/io/swagger/inflector/utils/VendorSpecFilter.java index c48a5c74..36fcd88b 100644 --- a/src/main/java/io/swagger/inflector/utils/VendorSpecFilter.java +++ b/src/main/java/io/swagger/inflector/utils/VendorSpecFilter.java @@ -34,8 +34,10 @@ public Map filterDefinitions(SwaggerSpecFilter filter, Map filteredDefinitions = super.filterDefinitions(filter, definitions, params, cookies, headers); - for (Model model : filteredDefinitions.values()) { - filterVendorExtensions(model.getVendorExtensions()); + if( filteredDefinitions != null ) { + for (Model model : filteredDefinitions.values()) { + filterVendorExtensions(model.getVendorExtensions()); + } } return filteredDefinitions;