Blob content qfix2 (#5929)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-06-27 15:37:44 +07:00 committed by GitHub
parent 5145a91a62
commit 777eb415aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,7 +40,7 @@ async function fetchContent (blob: Ref<Blob>, doc: YDoc): Promise<boolean> {
async function fetchBlobContent (_id: Ref<Blob>): Promise<Uint8Array | undefined> {
try {
const blob = (await getClient().findOne(core.class.Blob, { _id })) as BlobLookup
if (blob?.size === 0) {
if (blob === undefined || blob.size === 0) {
return undefined
}
const href = await getBlobHref(blob, _id)