1
0
Fork 0
forked from forgejo/forgejo

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

Backport #25698.

Fix #25697.

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

Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
Jason Song 2023-07-07 15:59:16 +08:00 committed by GitHub
parent e6801df99c
commit 53276d3e49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 11 deletions

View file

@ -1455,10 +1455,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