From 85a050fca70446ea7a9e10266bbe083d5d8b63ea Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 22 Mar 2017 13:20:29 -0400 Subject: issue: fix redirect to random issue if index does not exist (#4315) --- routers/repo/pull.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'routers/repo/pull.go') diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 9184c5e8..aa61dcd9 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -142,11 +142,7 @@ func ForkPost(ctx *context.Context, f form.CreateRepo) { func checkPullInfo(ctx *context.Context) *models.Issue { issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index")) if err != nil { - if models.IsErrIssueNotExist(err) { - ctx.Handle(404, "GetIssueByIndex", err) - } else { - ctx.Handle(500, "GetIssueByIndex", err) - } + ctx.NotFoundOrServerError("GetIssueByIndex", errors.IsIssueNotExist, err) return nil } ctx.Data["Title"] = issue.Title -- cgit v1.2.3