diff options
author | Nanguan Lin <70063547+lng2020@users.noreply.github.com> | 2023-12-05 16:29:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-05 08:29:43 +0000 |
commit | 49b98e45bc6301b74181282a410aa02d8e0b8f30 (patch) | |
tree | c99d77d5db0aae0be584d087ff60f930db5f36b2 /models/migrations/v1_21/v263.go | |
parent | a95d5b7702e37488e90c3e02016ab91f0c8b5153 (diff) | |
download | gitea-49b98e45bc6301b74181282a410aa02d8e0b8f30.tar.gz gitea-49b98e45bc6301b74181282a410aa02d8e0b8f30.zip |
Fix migration panic due to an empty review comment diff (#28334)
Fix #28328
```
func (p *PullRequestComment) GetDiffHunk() string {
if p == nil || p.DiffHunk == nil {
return ""
}
return *p.DiffHunk
}
```
This function in the package `go-github` may return an empty diff. When
it's empty, the following code will panic because it access `ss[1]`
https://github.com/go-gitea/gitea/blob/ec1feedbf582b05b6a5e8c59fb2457f25d053ba2/services/migrations/gitea_uploader.go#L861-L867
https://github.com/go-gitea/gitea/blob/ec1feedbf582b05b6a5e8c59fb2457f25d053ba2/modules/git/diff.go#L97-L101
Diffstat (limited to 'models/migrations/v1_21/v263.go')
0 files changed, 0 insertions, 0 deletions