From 4d4fee838fb7c38348d6e994a9d83246b8375c12 Mon Sep 17 00:00:00 2001 From: alecdwm Date: Thu, 18 Apr 2024 23:55:13 +0000 Subject: [PATCH] fix: rare crash in chaindata-provider --- packages/chaindata-provider/src/net.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/chaindata-provider/src/net.ts b/packages/chaindata-provider/src/net.ts index 8b59355373..e090a046e5 100644 --- a/packages/chaindata-provider/src/net.ts +++ b/packages/chaindata-provider/src/net.ts @@ -32,8 +32,8 @@ export const availableTokenLogoFilenames = async (): Promise => await fetch( `${githubApi}/repos/${githubChaindataOrg}/${githubChaindataRepo}/contents/${githubChaindataTokensAssetsDir}` ).then((response) => response.json()) - ).flatMap((entry: unknown) => { + )?.flatMap?.((entry: unknown) => { if (typeof entry !== "object" || entry === null) return [] if (!("name" in entry) || typeof entry.name !== "string") return [] return entry.name - }) + }) ?? []