Skip to content

Fix a NullPointerException when no groupId is provided#86

Closed
hatxet wants to merge 1 commit intojenkinsci:masterfrom
hatxet:fix/groupid-null-exception
Closed

Fix a NullPointerException when no groupId is provided#86
hatxet wants to merge 1 commit intojenkinsci:masterfrom
hatxet:fix/groupid-null-exception

Conversation

@hatxet
Copy link

@hatxet hatxet commented Dec 22, 2021

The documentation explicitly says that the teamPath parameter
overrides the groupId and it even recommends removing the groupId
parameter if the teamPath is set.
This fix prevents the CxCommonClient from throwing a NullPointerException
when the groupId is null if the teamPath parameter has some value.

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

The documentation explicitly says that the `teamPath` parameter
overrides the `groupId` and it even recommends removing the `groupId`
parameter if the `teamPath` is set.
This fix prevents the CxCommonClient from throwing a NullPointerException
when the `groupId` is null if the `teamPath` parameter has some value.
}
teamPath = getTeamNameFromId(cxConnectionDetails, descriptor, groupId);
if (teamPath == null) {
teamPath = getTeamNameFromId(cxConnectionDetails, descriptor, groupId);
Copy link
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
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.

@hatxet
Copy link
Author

hatxet commented Jan 22, 2022

It seems #89 fixes the issue, so I'll close this. Probably #65 needs to be closed too.

@hatxet hatxet closed this Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants