修复:invalid memory address or nil pointer dereference

This commit is contained in:
yystopf 2026-06-12 15:26:49 +08:00
parent 973b96914c
commit 8eded066ea
1 changed files with 10 additions and 0 deletions

View File

@ -46,6 +46,16 @@ func ChangePullRequestCloseStatus(ctx *context.APIContext) {
}
return
}
if err = pr.LoadBaseRepo(ctx); err != nil {
ctx.APIErrorInternal(err)
return
}
if err = pr.LoadHeadRepo(ctx); err != nil {
ctx.APIErrorInternal(err)
return
}
changeStatus := ctx.FormBool("is_closed")
if changeStatus {
_, err = issues_model.CloseIssue(ctx, pr.Issue, ctx.Doer)