From fc63d461bbcfc85fbf543ea89696b722f53f0cf3 Mon Sep 17 00:00:00 2001 From: port <108868128+portdeveloper@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:26:53 +0300 Subject: [PATCH] Check abi length and return if its 0 --- packages/nextjs/pages/index.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/nextjs/pages/index.tsx b/packages/nextjs/pages/index.tsx index 95c77b88..afc2a4aa 100644 --- a/packages/nextjs/pages/index.tsx +++ b/packages/nextjs/pages/index.tsx @@ -124,6 +124,11 @@ const Home: NextPage = () => { try { const response = await fetch(`https://heimdall-api.fly.dev/${network}/${contractAddress}`); const abi = await response.json(); + if (abi.length === 0) { + notification.error("Failed to fetch ABI from Heimdall. Please try again or enter ABI manually."); + setIsFetchingAbi(false); + return; + } setContractAbi(abi); setIsAbiAvailable(true); setAbiContractAddress(contractAddress);