Skip to content

Commit e2ce427

Browse files
committed
Fix NPE in JavaClientCodegen when model has no properties of its own
A model that inherits from another model and does not add its own properties causes JavaClientCodegen to crash silently with an NPE. Fixes #1141
1 parent 27e434d commit e2ce427

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,6 +1439,8 @@ private void addVars(CodegenModel m, Map<String, Property> properties, Collectio
14391439
}
14401440
} else {
14411441
m.emptyVars = true;
1442+
m.hasVars = false;
1443+
m.hasEnums = false;
14421444
}
14431445
}
14441446

0 commit comments

Comments
 (0)