From 638c01987579500bdacc527b9e03ca28ab886407 Mon Sep 17 00:00:00 2001 From: Brooks Boyd Date: Wed, 29 Nov 2023 08:45:13 -0600 Subject: [PATCH] External data from Covalent API could be null --- src/hooks/useGetSourceParsedTokenAccounts.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hooks/useGetSourceParsedTokenAccounts.ts b/src/hooks/useGetSourceParsedTokenAccounts.ts index f635dff3d..9a5209cde 100644 --- a/src/hooks/useGetSourceParsedTokenAccounts.ts +++ b/src/hooks/useGetSourceParsedTokenAccounts.ts @@ -655,12 +655,12 @@ const createNFTParsedTokenAccountFromCovalent = ( logo: covalent.logo_url, tokenId: nft_data.token_id, uri: nft_data.token_url, - animation_url: nft_data.external_data.animation_url, - external_url: nft_data.external_data.external_url, - image: nft_data.external_data.image, - image_256: nft_data.external_data.image_256, - nftName: nft_data.external_data.name, - description: nft_data.external_data.description, + animation_url: nft_data.external_data?.animation_url, + external_url: nft_data.external_data?.external_url, + image: nft_data.external_data?.image, + image_256: nft_data.external_data?.image_256, + nftName: nft_data.external_data?.name, + description: nft_data.external_data?.description, }; }; @@ -688,7 +688,7 @@ export type CovalentNFTExternalData = { export type CovalentNFTData = { token_id: string; token_balance: string | null; - external_data: CovalentNFTExternalData; + external_data: CovalentNFTExternalData | null; token_url: string; };