handle empty deltas

This commit is contained in:
Nikita Galaiko 2023-04-18 16:00:28 +02:00
parent bd429ca64a
commit 2ceeebfe2e

View File

@ -319,7 +319,14 @@ impl<'reader> SessionReader<'reader> {
.reader
.read_to_string(file_deltas_path.to_str().unwrap())
{
Ok(content) => Ok(Some(serde_json::from_str(&content)?)),
Ok(content) => {
if content.is_empty() {
// this is a leftover from some bug, shouldn't happen anymore
Ok(None)
} else {
Ok(Some(serde_json::from_str(&content)?))
}
}
Err(reader::Error::NotFound) => Ok(None),
Err(err) => Err(err.into()),
}