From b578a32a4460c0f26e3d027df038936b4ca818a4 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 18 Nov 2023 04:00:00 -0500 Subject: [PATCH] fix: wrap db.get in a try/catch --- src/node.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/node.ts b/src/node.ts index 35048b2..7c127b5 100644 --- a/src/node.ts +++ b/src/node.ts @@ -137,7 +137,12 @@ export class S5Node { hash: Multihash, ): Promise>>> { const map = new Map>>(); - const bytes = await this.db.get(stringifyHash(hash)); + let bytes; + try { + bytes = await this.db.get(stringifyHash(hash)); + } catch { + return map; + } if (bytes === null) { return map; }