rest backend: Allow null value in json

This commit is contained in:
Alexander Weiss 2023-06-14 06:27:30 +02:00
parent ea64c351d8
commit eec8513bef

View File

@ -191,7 +191,8 @@ impl ReadBackend for RestBackend {
.header("Accept", "application/vnd.x.restic.rest.v2")
.send()?
.check_error()?
.json::<Vec<ListEntry>>()?;
.json::<Option<Vec<ListEntry>>>()? // use Option to be handle null json value
.unwrap_or_default();
Ok(list
.into_iter()
.filter_map(|i| match Id::from_hex(&i.name) {