Skip to content

Commit

Permalink
Do not fail if page number isn't a page number (#2687)
Browse files Browse the repository at this point in the history
Co-authored-by: Cuihtlauac ALVARADO <[email protected]>
  • Loading branch information
cuihtlauac and Cuihtlauac ALVARADO authored Sep 9, 2024
1 parent 05936a3 commit d21a2c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ocamlorg_web/lib/handler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ let events _req =
let paginate ~req ~n items =
let items_per_page = n in
let page =
Dream.query req "p" |> Option.map int_of_string |> Option.value ~default:1
Option.bind (Dream.query req "p") int_of_string_opt
|> Option.value ~default:1
in
let number_of_pages =
int_of_float
Expand Down

0 comments on commit d21a2c7

Please sign in to comment.