Skip to content

Prevent NPE on invalid diff - #17197

Merged
6543 merged 2 commits into
go-gitea:mainfrom
zeripath:prevent-npe-17193
Sep 30, 2021
Merged

6543 merged 2 commits into
go-gitea:mainfrom
zeripath:prevent-npe-17193

Conversation

@zeripath

Copy link
Copy Markdown
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 Indicates a previously functioning feature or behavior that has broken or regressed after a change 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
Comment thread integrations/compare_test.go Outdated
@6543
6543 force-pushed the prevent-npe-17193 branch from c7c6022 to 2fc02b2 Compare September 30, 2021 16:58

@6543 6543 left a comment

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.

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

KN4CK3R commented Sep 30, 2021

Copy link
Copy Markdown
Member

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 Indicates a previously functioning feature or behavior that has broken or regressed after a change 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