Skip to content

Commit a569be6

Browse files
authored
Merge pull request #1138 from swagger-api/nullcheck
null check in SwaggerDeserializer 915
2 parents ebf1d63 + a727575 commit a569be6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/swagger-parser/src/main/java/io/swagger/parser/util/SwaggerDeserializer.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,8 +912,10 @@ public Model definition(ObjectNode node, String location, ParseResult result) {
912912
if(propertyNode.getNodeType().equals(JsonNodeType.OBJECT)) {
913913
ObjectNode on = (ObjectNode) propertyNode;
914914
Property property = property(on, location, result);
915-
if("array".equals( property.getType()) && !(property instanceof ArrayProperty && ((ArrayProperty) property).getItems() != null)) {
916-
result.missing(location, "items");
915+
if (property != null) {
916+
if ("array".equals(property.getType()) && !(property instanceof ArrayProperty && ((ArrayProperty) property).getItems() != null)) {
917+
result.missing(location, "items");
918+
}
917919
}
918920
impl.property(propertyName, property);
919921
}

0 commit comments

Comments
 (0)