Skip to content

Commit e55eef9

Browse files
committed
added check for null value
1 parent a922062 commit e55eef9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/io/swagger/codegen/v3/generators/php/PhpClientCodegen.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public PhpClientCodegen() {
110110

111111
instantiationTypes.put("array", "array");
112112
instantiationTypes.put("map", "map");
113-
113+
114114
// provide primitives to mustache template
115115
List<String> sortedLanguageSpecificPrimitives= new ArrayList<String>(languageSpecificPrimitives);
116116
Collections.sort(sortedLanguageSpecificPrimitives);
@@ -295,10 +295,10 @@ public void processOpts() {
295295
if (additionalProperties.containsKey(VARIABLE_NAMING_CONVENTION)) {
296296
this.setParameterNamingConvention((String) additionalProperties.get(VARIABLE_NAMING_CONVENTION));
297297
}
298-
if (StringUtils.isBlank(composerVendorName)) {
298+
if (StringUtils.isBlank(composerVendorName) && additionalProperties.get(CodegenConstants.GIT_USER_ID) != null) {
299299
additionalProperties.put(CodegenConstants.GIT_USER_ID, StringUtils.lowerCase(additionalProperties.get(CodegenConstants.GIT_USER_ID).toString()));
300300
}
301-
if (StringUtils.isBlank(composerProjectName)) {
301+
if (StringUtils.isBlank(composerProjectName) && additionalProperties.get(CodegenConstants.GIT_REPO_ID) != null) {
302302
additionalProperties.put(CodegenConstants.GIT_REPO_ID, StringUtils.lowerCase(additionalProperties.get(CodegenConstants.GIT_REPO_ID).toString()));
303303
}
304304

0 commit comments

Comments
 (0)