Client: ignore empty files

This commit is contained in:
Grégoire Henry 2017-11-08 15:46:57 +01:00 committed by Benjamin Canou
parent 0e2a751408
commit 6f5c51f050

View File

@ -99,7 +99,8 @@ module Alias = functor (Entity : Entity) -> struct
let load cctxt =
let filename = filename cctxt in
if not (Sys.file_exists filename) then
if not (Sys.file_exists filename) ||
Unix.(stat filename).st_size = 0 then
return []
else
Data_encoding_ezjsonm.read_file filename