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 in CommentMustAsDiff if no hunk header (#15199) #15201

Merged

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Mar 29, 2021

Backport #15199

I do not understand how this can happen or why.

There is an apparent possibility for a comment.Patch to be missing a hunk header

  • this should not happen and I do not understand how. But it appears to happen on
    1.13 at least in some case.

This PR will simply add a new section if the cursection is empty
thus preventing the NPE.

Fix #15198

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

Backport go-gitea#15199

I do not understand how this can happen or why.

There is an apparent possibility for a comment.Patch to be missing a hunk header
- this should not happen and do not understand how. But it appears to happen on
1.13 at least in some case.

This PR will simply add a new section if the cursection is empty
thus preventing the NPE.

Fix go-gitea#15198

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added this to the 1.13.7 milestone Mar 29, 2021
@zeripath zeripath changed the title Prevent NPE in CommentMustAsDiff if no hunk header (#1519) Prevent NPE in CommentMustAsDiff if no hunk header (#15199) Mar 29, 2021
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Apr 1, 2021
@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 Apr 1, 2021
@techknowlogick
Copy link
Member

🚀

@techknowlogick techknowlogick merged commit 1062931 into go-gitea:release/v1.13 Apr 1, 2021
@zeripath zeripath deleted the backport-15199-v1.13 branch April 1, 2021 20:19
@go-gitea go-gitea locked and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants