From 91afec43a67da5ae5862ea4b2a9aeaf131aaf07e Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Thu, 22 Oct 2015 15:43:02 -0700 Subject: [PATCH] fixed NPE on empty props --- .../main/java/io/swagger/codegen/plugin/CodeGenMojo.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java b/modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java index 805afe22a94..22726c84c04 100644 --- a/modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java +++ b/modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java @@ -131,7 +131,12 @@ public class CodeGenMojo extends AbstractMojo { if (environmentVariables != null) { for(String key : environmentVariables.keySet()) { - System.setProperty(key, environmentVariables.get(key)); + String value = environmentVariables.get(key); + if(value == null) { + // don't put null values + value = ""; + } + System.setProperty(key, value); } }