Merge pull request #1144 from ePaul/bugfix/1143-add-nullcheck-for-allowedvalues

Add null check to fix issue #1143
This commit is contained in:
wing328 2015-09-01 11:54:22 +08:00
commit 72255286b3

View File

@ -340,6 +340,8 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
continue;
List<String> values = (List<String>) allowableValues.get("values");
// put "enumVars" map into `allowableValues", including `name` and `value`
if (values == null)
continue;
List<Map<String, String>> enumVars = new ArrayList<Map<String, String>>();
for (String value : values) {
Map<String, String> enumVar = new HashMap<String, String>();