forked from loafle/openapi-generator-original
fix NPE in the C# Nancy generator (#1478)
This commit is contained in:
parent
c656194f22
commit
941b3ea015
@ -285,10 +285,12 @@ public class CSharpNancyFXServerCodegen extends AbstractCSharpCodegen {
|
|||||||
LOGGER.debug("Processing parents: " + parentModels);
|
LOGGER.debug("Processing parents: " + parentModels);
|
||||||
for (final String parent : parentModels) {
|
for (final String parent : parentModels) {
|
||||||
final CodegenModel parentModel = ModelUtils.getModelByName(parent, models);
|
final CodegenModel parentModel = ModelUtils.getModelByName(parent, models);
|
||||||
parentModel.hasChildren = true;
|
if (parentModel != null) {
|
||||||
final Collection<CodegenModel> childrenModels = childrenByParent.get(parent);
|
parentModel.hasChildren = true;
|
||||||
for (final CodegenModel child : childrenModels) {
|
final Collection<CodegenModel> childrenModels = childrenByParent.get(parent);
|
||||||
processParentPropertiesInChildModel(parentModel, child);
|
for (final CodegenModel child : childrenModels) {
|
||||||
|
processParentPropertiesInChildModel(parentModel, child);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user