Avoid a exception when reading a dir