Skip to content

Commit

Permalink
Fix custom field verification NPE issue (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
umeshwaghode authored Sep 6, 2022
1 parent 7a2f5ff commit 68a5130
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
description = Provides automatic scan of code by Checkmarx server and shows results summary and trend in Jenkins interface.
group = com.checkmarx.jenkins
version = 2022.3.2
version = 2022.3.3

repositoryVersion=

Expand Down
8 changes: 5 additions & 3 deletions src/main/java/com/checkmarx/jenkins/CxScanBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -1335,10 +1335,12 @@ private CxScanConfig resolveConfiguration(Run<?, ?> run, DescriptorImpl descript
ret.setMvnPath(descriptor.getMvnPath());
ret.setOsaGenerateJsonReport(false);

if(!verifyCustomCharacters(getCustomFields())) {
throw new CxClientException("Custom Fields must have given format: key1:val1,key2:val2. \\nCustom field allows to use these special characters: # . _ ");
if(StringUtils.isNotEmpty(getCustomFields())) {
if(!verifyCustomCharacters(getCustomFields())) {
throw new CxClientException("Custom Fields must have given format: key1:val1,key2:val2. \\nCustom field allows to use these special characters: # . _ ");
}
ret.setCustomFields(apiFormat(getCustomFields()));
}
ret.setCustomFields(apiFormat(getCustomFields()));
ret.setForceScan(isForceScan());

//cx server
Expand Down

0 comments on commit 68a5130

Please sign in to comment.