Skip to content

Commit ea5254e

Browse files
committed
Fallback if chain metadata fails on zk check
1 parent 8ec6324 commit ea5254e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Thirdweb/Thirdweb.Utils/Utils.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,16 @@ public static async Task<bool> IsZkSync(ThirdwebClient client, BigInteger chainI
312312
}
313313
else
314314
{
315-
var chainData = await GetChainMetadata(client, chainId).ConfigureAwait(false);
316-
return !string.IsNullOrEmpty(chainData.StackType) && chainData.StackType.Contains("zksync", StringComparison.OrdinalIgnoreCase);
315+
try
316+
{
317+
var chainData = await GetChainMetadata(client, chainId).ConfigureAwait(false);
318+
return !string.IsNullOrEmpty(chainData.StackType) && chainData.StackType.Contains("zksync", StringComparison.OrdinalIgnoreCase);
319+
}
320+
catch
321+
{
322+
// Assume it is not zkSync if the chain data could not be fetched
323+
return false;
324+
}
317325
}
318326
}
319327

0 commit comments

Comments
 (0)