aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/projects.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/projects.go')
-rw-r--r--routers/web/repo/projects.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/routers/web/repo/projects.go b/routers/web/repo/projects.go
index 0bf1f64d09..a57976b4ca 100644
--- a/routers/web/repo/projects.go
+++ b/routers/web/repo/projects.go
@@ -61,10 +61,7 @@ func Projects(ctx *context.Context) {
isShowClosed := strings.ToLower(ctx.FormTrim("state")) == "closed"
keyword := ctx.FormTrim("q")
repo := ctx.Repo.Repository
- page := ctx.FormInt("page")
- if page <= 1 {
- page = 1
- }
+ page := max(ctx.FormInt("page"), 1)
ctx.Data["OpenCount"] = repo.NumOpenProjects
ctx.Data["ClosedCount"] = repo.NumClosedProjects