aboutsummaryrefslogtreecommitdiff
path: root/routers/repo/pull.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-03-22 13:20:29 -0400
committerUnknwon <u@gogs.io>2017-03-22 13:20:29 -0400
commit85a050fca70446ea7a9e10266bbe083d5d8b63ea (patch)
tree23d3fcc2ce2fbd7f289477c1214ac0768e24d85b /routers/repo/pull.go
parentbb86d66496078b8c2fb242b6286d682ff9d5aa2f (diff)
issue: fix redirect to random issue if index does not exist (#4315)
Diffstat (limited to 'routers/repo/pull.go')
-rw-r--r--routers/repo/pull.go6
1 files changed, 1 insertions, 5 deletions
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