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

Prevent NPE on invalid diff #17197

Merged
merged 2 commits into from
Sep 30, 2021
Merged

Prevent NPE on invalid diff #17197

merged 2 commits into from
Sep 30, 2021

Conversation

zeripath
Copy link
Contributor

If ParseCompareInfo returns a nil compare info the defer function needs to ensure
that it does not attempt to close the HeadGitRepo.

Fix #17193
Regression #16635

Signed-off-by: Andrew Thornton art27@cantab.net

If ParseCompareInfo returns a nil compare info the defer function needs to ensure
that it does not attempt to close the HeadGitRepo.

Fix go-gitea#17193

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added type/bug issue/regression Issue needs no code to be fixed, only a description on how to fix it yourself skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels Sep 30, 2021
@zeripath zeripath added this to the 1.16.0 milestone Sep 30, 2021
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Sep 30, 2021
integrations/compare_test.go Outdated Show resolved Hide resolved
Copy link
Member

@6543 6543 left a comment

Choose a reason for hiding this comment

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

lgtm bot?

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Sep 30, 2021
@KN4CK3R
Copy link
Member

KN4CK3R commented Sep 30, 2021

lgtm likes me 🙂

@6543 6543 merged commit 206ea10 into go-gitea:main Sep 30, 2021
@zeripath zeripath deleted the prevent-npe-17193 branch September 30, 2021 19:33
Chianina pushed a commit to Chianina/gitea that referenced this pull request Oct 15, 2021
* Prevent NPE on invalid diff

If ParseCompareInfo returns a nil compare info the defer function needs to ensure
that it does not attempt to close the HeadGitRepo.

Fix go-gitea#17193

Signed-off-by: Andrew Thornton <art27@cantab.net>

* add TEST

Co-authored-by: 6543 <6543@obermui.de>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/regression Issue needs no code to be fixed, only a description on how to fix it yourself lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nil Pointer 500 in compare view
5 participants