forgejo/services
zeripath 2705696d4d
Prevent NPE in CommentMustAsDiff if no hunk header (#15199) (#15200)
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>

Co-authored-by: 6543 <6543@obermui.de>
2021-04-01 15:14:56 -04:00
..
archiver migrate from com.* to alternatives (#14103) 2020-12-25 11:59:32 +02:00
comments Enhance Ghost comment mitigation Settings (#14392) 2021-01-21 21:56:19 -05:00
externalaccount Allow externalID to be UUID (#8551) 2019-10-17 10:06:28 +08:00
gitdiff Prevent NPE in CommentMustAsDiff if no hunk header (#15199) (#15200) 2021-04-01 15:14:56 -04:00
issue label and milestone webhooks on issue/pull creation (#14363) 2021-01-17 16:15:57 +02:00
mailer Repository transfer has to be confirmed, if user can not create repo for new owner (#14792) 2021-03-01 01:47:30 +01:00
mirror Create tag on ui (#13467) 2021-02-28 19:57:45 +00:00
pull IsUserAllowedToUpdate ignore igonre if user is nil (#14885) 2021-03-04 19:27:54 +01:00
release Create tag on ui (#13467) 2021-02-28 19:57:45 +00:00
repository Repository transfer has to be confirmed, if user can not create repo for new owner (#14792) 2021-03-01 01:47:30 +01:00
webhook Migrate to use jsoniter instead of encoding/json (#14841) 2021-03-01 22:08:10 +01:00
wiki migrate from com.* to alternatives (#14103) 2020-12-25 11:59:32 +02:00