Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/java/com/checkmarx/jenkins/CxScanBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,9 @@ private CxScanConfig resolveConfiguration(Run<?, ?> run, DescriptorImpl descript
} else {
ret.setProxy(false);
}
teamPath = getTeamNameFromId(cxConnectionDetails, descriptor, groupId);
if (teamPath == null) {
teamPath = getTeamNameFromId(cxConnectionDetails, descriptor, groupId);
Copy link
Copy Markdown
Member

@scurvydoggo scurvydoggo Jan 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this actually fix the issue?

The title of the PR says "when no groupId is provided", however here it is testing teamPath for null, and continuing to use groupId as a parameter.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, it looks good to me, based on your description

This fix prevents the CxCommonClient from throwing a NullPointerException when the groupId is null if the teamPath parameter has some value.

So the idea is to skip this step if the teamPath is already set with something.

}
//project
ret.setProjectName(env.expand(projectName.trim()));
ret.setTeamPath(teamPath);
Expand Down