From ffeadd4e293eeeb9ff0fa1679a76751eb5e74645 Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Thu, 29 Oct 2020 13:17:35 +0800 Subject: [PATCH] Explorer: don't throw error for strange token instructions (#13268) --- explorer/src/providers/accounts/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/explorer/src/providers/accounts/index.tsx b/explorer/src/providers/accounts/index.tsx index 2e61d504f3..b317b888c5 100644 --- a/explorer/src/providers/accounts/index.tsx +++ b/explorer/src/providers/accounts/index.tsx @@ -243,7 +243,7 @@ export function useMintAccountInfo( const data = accountInfo?.data?.details?.data; if (!data) return; if (data.program !== "spl-token" || data.parsed.type !== "mint") { - throw new Error("Expected mint"); + return; } return coerce(data.parsed.info, MintAccountInfo); @@ -263,7 +263,7 @@ export function useTokenAccountInfo( const data = accountInfo?.data?.details?.data; if (!data) return; if (data.program !== "spl-token" || data.parsed.type !== "account") { - throw new Error("Expected token account"); + return; } return coerce(data.parsed.info, TokenAccountInfo);