Fix malformed meta files causing panics.

Fixes #280.
This commit is contained in:
Lucien Greathouse
2020-03-13 20:38:06 -07:00
parent 6de74b41b3
commit 1cbe272e19
6 changed files with 25 additions and 15 deletions

View File

@@ -46,8 +46,8 @@ impl SnapshotMiddleware for SnapshotCsv {
.relevant_paths(vec![path.to_path_buf(), meta_path.clone()]),
);
if let Some(meta_contents) = vfs.read(meta_path).with_not_found()? {
let mut metadata = AdjacentMetadata::from_slice(&meta_contents);
if let Some(meta_contents) = vfs.read(&meta_path).with_not_found()? {
let mut metadata = AdjacentMetadata::from_slice(&meta_contents, &meta_path)?;
metadata.apply_all(&mut snapshot);
}