Skip to content

Commit b278961

Browse files
committed
fix issue swagger-api#1143: add another null check.
The problem was trying to iterate over a null list.
1 parent 9e5de7d commit b278961

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/languages/JavaClientCodegen.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ public Map<String, Object> postProcessModels(Map<String, Object> objs) {
331331
continue;
332332
List<String> values = (List<String>) allowableValues.get("values");
333333
// put "enumVars" map into `allowableValues", including `name` and `value`
334+
if (values == null)
335+
continue;
334336
List<Map<String, String>> enumVars = new ArrayList<Map<String, String>>();
335337
for (String value : values) {
336338
Map<String, String> enumVar = new HashMap<String, String>();

0 commit comments

Comments
 (0)