From a82e7516adc36df219ba098414d8ae4f6285bdff Mon Sep 17 00:00:00 2001 From: rafapaezbas Date: Sat, 28 Mar 2026 19:10:43 +0100 Subject: [PATCH] skip block map reading of empty files --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 4a07ba5..941d36d 100644 --- a/index.js +++ b/index.js @@ -175,7 +175,7 @@ class Hyperblobs { } async getByteLength(id) { - if (!id.blockMap) return id.byteLength + if (!id.blockMap || id.byteLength === 0) return id.byteLength const map = await this.getBlockMap(id) let size = 0 for (const b of map.blocks) size += b.byteLength