From ce9c24aab81e09594ff3c9bd415d5ce3d6987a2f Mon Sep 17 00:00:00 2001 From: okanzdmr Date: Fri, 12 Aug 2022 00:02:45 +0300 Subject: [PATCH] fix: null metadata check --- .../extension-onboarding/src/components/NFTItem/NFTItem.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/extension-onboarding/src/components/NFTItem/NFTItem.tsx b/packages/extension-onboarding/src/components/NFTItem/NFTItem.tsx index 85ebb810b7..de801f8ca2 100644 --- a/packages/extension-onboarding/src/components/NFTItem/NFTItem.tsx +++ b/packages/extension-onboarding/src/components/NFTItem/NFTItem.tsx @@ -14,9 +14,9 @@ const NFTItem: FC = ({ item }: INFTItemProps) => { const regexpImage = /(\"image.*?\":\s*?\"(\s*?.*?\s*?)\")/; const regexpUrl = /(https?|ipfs):\/\/([-A-Z0-9.]+)(\/[-A-Z0-9+&@#\/%=~_|!:,.;]*)/i; - const splittedData = item.metadata.split(regexpImage); + const splittedData = item.metadata?.split(regexpImage); const extractedImages: string[] = []; - splittedData.forEach((key) => { + splittedData?.forEach((key) => { if (regexpImage.test(key)) { const imageUrl = key.match(regexpImage)?.[2]; if (imageUrl && regexpUrl.test(imageUrl)) {