diff --git a/lib/picos/picos.ocaml5.ml b/lib/picos/picos.ocaml5.ml index 8f418cf6..be3e784c 100644 --- a/lib/picos/picos.ocaml5.ml +++ b/lib/picos/picos.ocaml5.ml @@ -392,8 +392,8 @@ module Computation = struct -> unit Effect.t let cancel_after computation ~seconds exn bt = - if not (0.0 <= seconds) then error_negative_or_nan (); - Effect.perform (Cancel_after { seconds; exn; bt; computation }) + if not (0.0 <= seconds) then error_negative_or_nan () + else Effect.perform (Cancel_after { seconds; exn; bt; computation }) (* BEGIN COMPUTATION COMMON *)