Skip to content

Commit

Permalink
fix(API): Fix listing exercise status when the status list hasn't bee…
Browse files Browse the repository at this point in the history
…n initialized; Fix #314
  • Loading branch information
AltGr authored and erikmd committed Oct 15, 2021
1 parent 03d871a commit 3c781cb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/state/learnocaml_store.ml
Expand Up @@ -203,7 +203,12 @@ module Exercise = struct
List.iter (fun st -> Hashtbl.add tbl st.id st) l;
tbl)
@@ function
| Unix.Unix_error (Unix.ENOENT, _, _) -> Lwt.return tbl
| Unix.Unix_error (Unix.ENOENT, _, _) ->
Lazy.force !index >>= fun index ->
Exercise.Index.fold_exercises (fun () id _ ->
Hashtbl.add tbl id (Exercise.Status.default id))
() index;
Lwt.return tbl
| e -> Lwt.fail e
)

Expand Down

0 comments on commit 3c781cb

Please sign in to comment.