Skip to content

Commit

Permalink
Check abi length and return if its 0
Browse files Browse the repository at this point in the history
  • Loading branch information
portdeveloper committed Apr 3, 2024
1 parent b475868 commit fc63d46
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/nextjs/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fc63d46

Please sign in to comment.