Skip to content

Commit 91afec4

Browse files
committed
fixed NPE on empty props
1 parent adeff78 commit 91afec4

File tree

1 file changed

+6
-1
lines changed
  • modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin

1 file changed

+6
-1
lines changed

modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,12 @@ public void execute() throws MojoExecutionException {
131131

132132
if (environmentVariables != null) {
133133
for(String key : environmentVariables.keySet()) {
134-
System.setProperty(key, environmentVariables.get(key));
134+
String value = environmentVariables.get(key);
135+
if(value == null) {
136+
// don't put null values
137+
value = "";
138+
}
139+
System.setProperty(key, value);
135140
}
136141
}
137142

0 commit comments

Comments
 (0)