gitea/services
zeripath 2705696d4d
Prevent NPE in CommentMustAsDiff if no hunk header () ()
Backport 

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 

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

Co-authored-by: 6543 <6543@obermui.de>
..
archiver migrate from com.* to alternatives ()
comments Enhance Ghost comment mitigation Settings ()
externalaccount Allow externalID to be UUID ()
gitdiff Prevent NPE in CommentMustAsDiff if no hunk header () ()
issue label and milestone webhooks on issue/pull creation ()
mailer Repository transfer has to be confirmed, if user can not create repo for new owner ()
mirror Create tag on ui ()
pull IsUserAllowedToUpdate ignore igonre if user is nil ()
release Create tag on ui ()
repository Repository transfer has to be confirmed, if user can not create repo for new owner ()
webhook Migrate to use jsoniter instead of encoding/json ()
wiki migrate from com.* to alternatives ()