Skip to content

Commit f2f277c

Browse files
a1012112796lunny
authored andcommitted
Show 404 page when release not found (go-gitea#12328)
Signed-off-by: a1012112796 <[email protected]> Co-authored-by: Lunny Xiao <[email protected]>
1 parent ad68c9c commit f2f277c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

routers/repo/release.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ func SingleRelease(ctx *context.Context) {
134134

135135
release, err := models.GetRelease(ctx.Repo.Repository.ID, ctx.Params("tag"))
136136
if err != nil {
137+
if models.IsErrReleaseNotExist(err) {
138+
ctx.NotFound("GetRelease", err)
139+
return
140+
}
137141
ctx.ServerError("GetReleasesByRepoID", err)
138142
return
139143
}

0 commit comments

Comments
 (0)