1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-04 14:46:57 -05:00
gitea/services/gitdiff
zeripath 1062931cf1
Prevent NPE in CommentMustAsDiff if no hunk header (#1519) (#15201)
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 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>
2021-04-01 14:30:44 -04:00
..
testdata/academic-module Fix panic when diff (#9187) 2019-11-28 17:05:57 +08:00
gitdiff_test.go Fix a couple of CommentAsPatch issues. (#14804) (#14820) 2021-02-28 15:19:51 +02:00
gitdiff.go Prevent NPE in CommentMustAsDiff if no hunk header (#1519) (#15201) 2021-04-01 14:30:44 -04:00
main_test.go Move git diff codes from models to services/gitdiff (#7889) 2019-09-05 22:20:09 -04:00