···402402(* Internal marshal to bytes buffer *)
403403let marshal_bytes (buf : bytes) t =
404404 let parts = t.partitions in
405405- let nth i = try List.nth parts i with _ -> empty_partition in
405405+ let nth i =
406406+ try List.nth parts i with Failure _ | Invalid_argument _ -> empty_partition
407407+ in
406408 let raw =
407409 {
408410 bootstrap1 = String.sub t.bootstrap_code 0 bootstrap_code1_len;