Permalink
Browse files

Don't die on invalid page numbers (default to 1)

  • Loading branch information...
1 parent ef23fd8 commit 4f368f3b07dcbf2f762dba98ccd2cd9e1588dcda @cdaddr committed Jul 27, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/blog/middleware.clj
View
2 src/blog/middleware.clj
@@ -86,7 +86,7 @@
[handler]
(fn [request]
(let [{{page-number "p"} :query-params} request]
- (binding [PAGE-NUMBER (or (util/safe-int page-number) 1)]
+ (binding [PAGE-NUMBER (or (try (util/safe-int page-number) (catch Exception _ 1)) 1)]
(handler request)))))
(declare USER)

0 comments on commit 4f368f3

Please sign in to comment.