From cf9487f5d3ff30ec1b0e645e0eb666fa22eda2da Mon Sep 17 00:00:00 2001 From: M-Picco Date: Wed, 12 Mar 2025 14:43:15 -0300 Subject: [PATCH] Add try/catch to supportedDestinationTokens when checking whether a token is supported by ntt --- wormhole-connect/src/routes/sdkv2/route.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/wormhole-connect/src/routes/sdkv2/route.ts b/wormhole-connect/src/routes/sdkv2/route.ts index 92a69a4c4..ce0993f28 100644 --- a/wormhole-connect/src/routes/sdkv2/route.ts +++ b/wormhole-connect/src/routes/sdkv2/route.ts @@ -357,13 +357,17 @@ const isNttSupportedToken = async ( const route: SDKv2Route | undefined = config.routes.get(routeName); if (!route) return false; - const destTokens = await route.rc.supportedDestinationTokens( - token, - fromContext, - toContext, - ); - - return destTokens.length > 0; + try { + const destTokens = await route.rc.supportedDestinationTokens( + token, + fromContext, + toContext, + ); + + return destTokens.length > 0; + } catch (e) { + return false; + } }; const [isManualSupported, isAutomaticSupported, isM0Supported] =