1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-09 11:08:19 +00:00

Make DeleteIssue use correct context (#24885)

Fix #24884 , the `ctx.Repo.GitRepo` might be nil.
This commit is contained in:
wxiaoguang
2023-05-24 01:11:19 +08:00
committed by GitHub
parent e7757aa4be
commit d19d5bc5b8
3 changed files with 8 additions and 7 deletions

View File

@@ -880,7 +880,7 @@ func DeleteIssue(ctx *context.APIContext) {
return
}
if err = issue_service.DeleteIssue(ctx.Doer, ctx.Repo.GitRepo, issue); err != nil {
if err = issue_service.DeleteIssue(ctx, ctx.Doer, ctx.Repo.GitRepo, issue); err != nil {
ctx.Error(http.StatusInternalServerError, "DeleteIssueByID", err)
return
}

View File

@@ -978,7 +978,7 @@ func DeleteIssue(ctx *context.Context) {
return
}
if err := issue_service.DeleteIssue(ctx.Doer, ctx.Repo.GitRepo, issue); err != nil {
if err := issue_service.DeleteIssue(ctx, ctx.Doer, ctx.Repo.GitRepo, issue); err != nil {
ctx.ServerError("DeleteIssueByID", err)
return
}