]> source.dussan.org Git - gitea.git/commitdiff
Show 404 page when release not found (#12328) (#12332)
authortechknowlogick <techknowlogick@gitea.io>
Sun, 26 Jul 2020 21:39:44 +0000 (17:39 -0400)
committerGitHub <noreply@github.com>
Sun, 26 Jul 2020 21:39:44 +0000 (00:39 +0300)
Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 赵智超 <1012112796@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
routers/repo/release.go

index 1845563bcf759f0f829e364a2a3e283933273add..3b8e55f00246ee8e9615102d2a1ee305c06661a1 100644 (file)
@@ -134,6 +134,10 @@ func SingleRelease(ctx *context.Context) {
 
        release, err := models.GetRelease(ctx.Repo.Repository.ID, ctx.Params("tag"))
        if err != nil {
+               if models.IsErrReleaseNotExist(err) {
+                       ctx.NotFound("GetRelease", err)
+                       return
+               }
                ctx.ServerError("GetReleasesByRepoID", err)
                return
        }