diff --git a/wnfs-wasm/src/fs/blockstore.rs b/wnfs-wasm/src/fs/blockstore.rs index 2e930a23..e68d2de1 100644 --- a/wnfs-wasm/src/fs/blockstore.rs +++ b/wnfs-wasm/src/fs/blockstore.rs @@ -69,6 +69,10 @@ impl WnfsBlockStore for ForeignBlockStore { .await .map_err(anyhow_error("Cannot get block: {:?}"))?; + if value.is_undefined() { + return Err(BlockStoreError::CIDNotFound(*cid)); + } + // Convert the value to a vector of bytes. let bytes = Uint8Array::new(&value).to_vec(); Ok(Bytes::from(bytes))