From 588f3215c6c4a82c7ad9cbd2cc6a5683d0ca3cc2 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Mon, 16 Mar 2015 04:04:27 -0400 Subject: #1040: dashboard no longer accessible when repo is missing --- modules/middleware/repo.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/middleware/repo.go') diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go index 3350c03d22..a200d6d66f 100644 --- a/modules/middleware/repo.go +++ b/modules/middleware/repo.go @@ -47,7 +47,7 @@ func ApiRepoAssignment() macaron.Handler { // Get repository. repo, err := models.GetRepositoryByName(u.Id, repoName) if err != nil { - if err == models.ErrRepoNotExist { + if models.IsErrRepoNotExist(err) { ctx.Error(404) } else { ctx.JSON(500, &base.ApiJsonErr{"GetRepositoryByName: " + err.Error(), base.DOC_URL}) @@ -223,7 +223,7 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler { // Get repository. repo, err := models.GetRepositoryByName(u.Id, repoName) if err != nil { - if err == models.ErrRepoNotExist { + if models.IsErrRepoNotExist(err) { ctx.Handle(404, "GetRepositoryByName", err) } else { ctx.Handle(500, "GetRepositoryByName", err) -- cgit v1.2.3