Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-70158] Fix null pointer exception in GitSCMFileSystem #1362

Merged
merged 2 commits into from Nov 26, 2022

Conversation

MarkEWaite
Copy link
Contributor

@MarkEWaite MarkEWaite commented Nov 26, 2022

JENKINS-70158 Fix null pointer exception in GitSCMFileSystem

  • Duplicate null pointer exception in a test (12fca98)
  • Fix null pointer exception in GitSCMFileSystem (18463b8)

When rev was not null and env was null, a null pointer exception was thrown as the code tried to use the null env to expand environment variables in the rev argument.

First commit duplicates the null pointer exception in a test. Second commit resolves the null pointer exception.

Checklist

  • I have read the CONTRIBUTING doc
  • I have referenced the Jira issue related to my changes in one or more commit messages
  • I have added tests that verify my changes
  • Unit tests pass locally with my changes
  • I have added documentation as necessary
  • No Javadoc warnings were introduced with my changes
  • No spotbugs warnings were introduced with my changes
  • Documentation in README has been updated as necessary
  • Online help has been added and reviewed for any new or modified fields
  • I have interactively tested my changes
  • Any dependent changes have been merged and published in upstream modules (like git-client-plugin)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Additional comments

@MartinKosicky sorry that we missed the null pointer exception in the code review and in the test automation. Thanks very much for your pull request and for the automated tests that you added. Those tests made it very simple to add one more test for the null pointer exception. That failing test then made it easy to fix the issue in the main code. Thanks again!

@MarkEWaite MarkEWaite added the bugfix Fixes a bug - used by Release Drafter label Nov 26, 2022
@github-actions github-actions bot added the test label Nov 26, 2022
@MarkEWaite MarkEWaite changed the title Fix null pointer exception in GitSCMFileSystem [JENKINS-70158] Fix null pointer exception in GitSCMFileSystem Nov 26, 2022
When rev was not null and env was null, a null pointer exception was
thrown as the code tried to use the null env to expand environment
variables in the rev argument.

Test duplicates the null pointer exception and this commit resolves the
null pointer exception.
@MarkEWaite MarkEWaite merged commit 259d353 into jenkinsci:master Nov 26, 2022
@MarkEWaite MarkEWaite deleted the fix-NPE-in-GitSCMFileSystem branch November 26, 2022 23:26
@jglick
Copy link
Member

jglick commented Nov 28, 2022

Does this amend #1305?

@MarkEWaite
Copy link
Contributor Author

Does this amend #1305?

Yes, it corrects a null pointer exception that was introduced in #1305

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes a bug - used by Release Drafter
Projects
None yet
2 participants