Skip to content

Commit 32ffab4

Browse files
committed
fix issue #1143: add another null check.
The problem was trying to iterate over a null list.
1 parent e3c6cc3 commit 32ffab4

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

+2
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ public Map<String, Object> postProcessModels(Map<String, Object> objs) {
342342
continue;
343343
List<String> values = (List<String>) allowableValues.get("values");
344344
// put "enumVars" map into `allowableValues", including `name` and `value`
345+
if (values == null)
346+
continue;
345347
List<Map<String, String>> enumVars = new ArrayList<Map<String, String>>();
346348
for (String value : values) {
347349
Map<String, String> enumVar = new HashMap<String, String>();

0 commit comments

Comments
 (0)