fix returning outer pbnode when empty inner

This commit is contained in:
Joonas Koivunen 2020-06-10 20:29:47 +03:00
parent 0aca44906e
commit 7043fe2543

View File

@ -98,7 +98,7 @@ impl<'a> FlatUnixFs<'a> {
let data = match node.Data {
Some(Cow::Borrowed(bytes)) if !bytes.is_empty() => Some(bytes),
Some(Cow::Owned(_)) => unreachable!(),
Some(Cow::Borrowed(_)) | None => return Err((UnixFsReadFailed::NoData, None)),
Some(Cow::Borrowed(_)) | None => return Err((UnixFsReadFailed::NoData, Some(node))),
};
match UnixFs::try_from(data) {