Skip to content

Commit 4f368f3

Browse files
committed
Don't die on invalid page numbers (default to 1)
1 parent ef23fd8 commit 4f368f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/blog/middleware.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
[handler]
8787
(fn [request]
8888
(let [{{page-number "p"} :query-params} request]
89-
(binding [PAGE-NUMBER (or (util/safe-int page-number) 1)]
89+
(binding [PAGE-NUMBER (or (try (util/safe-int page-number) (catch Exception _ 1)) 1)]
9090
(handler request)))))
9191

9292
(declare USER)

0 commit comments

Comments
 (0)