Skip to content

Commit

Permalink
fix NPE in the C# Nancy generator (#1478)
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 authored and jimschubert committed Nov 17, 2018
1 parent c656194 commit 941b3ea
Showing 1 changed file with 6 additions and 4 deletions.
Expand Up @@ -285,10 +285,12 @@ private void postProcessParentModels(final Map<String, Object> models) {
LOGGER.debug("Processing parents: " + parentModels);
for (final String parent : parentModels) {
final CodegenModel parentModel = ModelUtils.getModelByName(parent, models);
parentModel.hasChildren = true;
final Collection<CodegenModel> childrenModels = childrenByParent.get(parent);
for (final CodegenModel child : childrenModels) {
processParentPropertiesInChildModel(parentModel, child);
if (parentModel != null) {
parentModel.hasChildren = true;
final Collection<CodegenModel> childrenModels = childrenByParent.get(parent);
for (final CodegenModel child : childrenModels) {
processParentPropertiesInChildModel(parentModel, child);
}
}
}
}
Expand Down

0 comments on commit 941b3ea

Please sign in to comment.