Skip to content

Commit a42e689

Browse files
committed
[TOOL-4986] Fix ERC20 asset page crash
1 parent d2c12cc commit a42e689

File tree

1 file changed

+17
-13
lines changed
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/_components

1 file changed

+17
-13
lines changed

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/_components/getContractCreator.tsx

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,23 @@ export async function getContractCreator(
99
contract: ThirdwebContract,
1010
functionSelectors: string[],
1111
) {
12-
if (isOwnerSupported(functionSelectors)) {
13-
return owner({
14-
contract,
15-
});
16-
}
12+
try {
13+
if (isOwnerSupported(functionSelectors)) {
14+
return await owner({
15+
contract,
16+
});
17+
}
1718

18-
if (isGetRoleAdminSupported(functionSelectors)) {
19-
return getRoleMember({
20-
contract,
21-
index: BigInt(0),
22-
role: "admin",
23-
});
24-
}
19+
if (isGetRoleAdminSupported(functionSelectors)) {
20+
return await getRoleMember({
21+
contract,
22+
index: BigInt(0),
23+
role: "admin",
24+
});
25+
}
2526

26-
return null;
27+
return null;
28+
} catch {
29+
return null;
30+
}
2731
}

0 commit comments

Comments
 (0)