Skip to content

Commit

Permalink
added null check for #132
Browse files Browse the repository at this point in the history
  • Loading branch information
fehguy committed Nov 7, 2015
1 parent 8d93afe commit d14be82
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,15 @@ public String processRefToExternalDefinition(String $ref, RefFormat refFormat) {
//If this is a new model, then check it for other sub references
//Loop the properties and recursively call this method;
Map<String, Property> subProps = model.getProperties();
for(Map.Entry<String,Property> prop: subProps.entrySet()){
if(prop.getValue() instanceof RefProperty){
RefProperty subRef = (RefProperty)prop.getValue();
subRef.set$ref(processRefToExternalDefinition(subRef.get$ref(),subRef.getRefFormat()));
}
if(subProps != null) {
for (Map.Entry<String, Property> prop : subProps.entrySet()) {
if (prop.getValue() instanceof RefProperty) {
RefProperty subRef = (RefProperty) prop.getValue();
subRef.set$ref(processRefToExternalDefinition(subRef.get$ref(), subRef.getRefFormat()));
}
}
}
swagger.addDefinition(newRef, model);

}

return newRef;
Expand Down

0 comments on commit d14be82

Please sign in to comment.