From 8eded066ea36e5f344599f0efae82fe235a95a13 Mon Sep 17 00:00:00 2001 From: yystopf Date: Fri, 12 Jun 2026 15:26:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9Ainvalid=20memory=20a?= =?UTF-8?q?ddress=20or=20nil=20pointer=20dereference?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/hat/repo/pull.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/routers/hat/repo/pull.go b/routers/hat/repo/pull.go index 842eb49..ea866bc 100644 --- a/routers/hat/repo/pull.go +++ b/routers/hat/repo/pull.go @@ -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)