-
Notifications
You must be signed in to change notification settings - Fork 664
Add null protection
#3064
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
Add null protection
#3064
Conversation
1034ea1 to
8531e72
Compare
8531e72 to
1bb17ad
Compare
b2fc0ba to
47ab122
Compare
- Add null check to GitRepository - Also refactor the code a bit for readability
- Add various null checks to `RepositoryStore`. - Also refactor the code a bit for readability.
47ab122 to
7a69997
Compare
|
Can you also add the null check for these classes? |
arturcic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@asbjornu will you also add for the other 2? |
|
https://github.com/GitTools/GitVersion/actions/runs/2088880949 - this one seems to be green |
- Add various null checks to `BranchCollection`. - Also refactor the code a bit for readability and improved stack traces.
2790f27 to
c0e139a
Compare
|
I think it's failing on your branch on your repo, not on GtiTools, because it's trying to use some envvars that you do not have setup |
|
Yes, that was my thought as well, @arturcic. But that doesn't explain why previous commits as well as the amended commit are all green? 🤔 Anyway, as the commit is now successful, I'll continue pushing the other files as well. |
|
Thank you @asbjornu for your contribution! |




Add
nullguards toGitObjectandObjectIdto avoidNullReferenceException.Description
This PR is an exploration of which
nullguards we can add to avoidNullReferenceExceptionand possibly also avoidingnullbefore they reachGitVersion.Core.Related Issue
Resolves #2775.
The following issues aren't fixed as this PR doesn't address the underlying issues, but this PR will provide a much more informative stack trace so if anyone encounters the underlying issues again, we'll have a better chance at figuring out what the issue is and actually fix it.
Closes #2605.
Closes #2631.
Closes #2695.
Closes #2734.
Closes #2825.
Motivation and Context
See #2775 and all linked issues.
How Has This Been Tested?
I'm counting on our existing test coverage to sufficiently exercise the code involved.
Screenshots (if appropriate):
Checklist: