mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-10-13 16:03:43 +00:00
Add Null-check and return if null (#21556)
This commit is contained in:
parent
0995e5935c
commit
ca8c6d2f5d
@ -1105,13 +1105,16 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf
|
||||
addtionalPropertiesName = schema.getTitle();
|
||||
} else {
|
||||
Schema additionalProperties = ModelUtils.getAdditionalProperties(schema);
|
||||
if (additionalProperties.getTitle() != null) {
|
||||
if(additionalProperties == null) {
|
||||
return;
|
||||
} else if (additionalProperties.getTitle() != null) {
|
||||
addtionalPropertiesName = additionalProperties.getTitle();
|
||||
} else if (additionalProperties.get$ref() != null) {
|
||||
String ref = ModelUtils.getSimpleRef(additionalProperties.get$ref());
|
||||
addtionalPropertiesName = toVarName(toModelName(ref));
|
||||
}
|
||||
}
|
||||
|
||||
properties.put(addtionalPropertiesName, schema);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user