1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-11 03:58:20 +00:00

Check ctx.Written() for GetActionIssue (#25698) (#25711)

Backport #25698 by @wolfogre

Fix #25697.

Just avoid panic, maybe there's another bug to trigger this case.

Co-authored-by: Jason Song <i@wolfogre.com>
This commit is contained in:
Giteabot
2023-07-06 15:04:26 -04:00
committed by GitHub
parent 68e0c802f7
commit 03cacf971e
5 changed files with 20 additions and 11 deletions

View File

@@ -1470,10 +1470,10 @@ func DownloadPullDiffOrPatch(ctx *context.Context, patch bool) {
// UpdatePullRequestTarget change pull request's target branch
func UpdatePullRequestTarget(ctx *context.Context) {
issue := GetActionIssue(ctx)
pr := issue.PullRequest
if ctx.Written() {
return
}
pr := issue.PullRequest
if !issue.IsPull {
ctx.Error(http.StatusNotFound)
return