Skip to content

Commit 1b8b83e

Browse files
committed
fixed NPE for goland generators
1 parent 61b82ca commit 1b8b83e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/io/swagger/codegen/v3/generators/DefaultCodegenConfig.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2697,7 +2697,9 @@ else if (schema instanceof ArraySchema) {
26972697
if (codegenProperty.complexType != null) {
26982698
imports.add(codegenProperty.complexType);
26992699
}
2700-
imports.add(codegenProperty.baseType);
2700+
if (codegenParameter.baseType != null) {
2701+
imports.add(codegenProperty.baseType);
2702+
}
27012703
CodegenProperty innerCp = codegenProperty;
27022704
while(innerCp != null) {
27032705
if(innerCp.complexType != null) {
@@ -2717,7 +2719,9 @@ else if (schema instanceof ArraySchema) {
27172719
setParameterNullable(codegenParameter, codegenProperty);
27182720

27192721
while (codegenProperty != null) {
2720-
imports.add(codegenProperty.baseType);
2722+
if (codegenProperty.baseType != null) {
2723+
imports.add(codegenProperty.baseType);
2724+
}
27212725
codegenProperty = codegenProperty.items;
27222726
}
27232727
}

0 commit comments

Comments
 (0)