Skip to content

Commit 8bd526f

Browse files
authoredMar 12, 2025··
Add try/catch to supportedDestinationTokens when checking whether a token is supported by ntt (#3354)
1 parent 2f32a96 commit 8bd526f

File tree

1 file changed

+11
-7
lines changed
  • wormhole-connect/src/routes/sdkv2

1 file changed

+11
-7
lines changed
 

‎wormhole-connect/src/routes/sdkv2/route.ts

+11-7
Original file line numberDiff line numberDiff line change
@@ -357,13 +357,17 @@ const isNttSupportedToken = async (
357357
const route: SDKv2Route | undefined = config.routes.get(routeName);
358358
if (!route) return false;
359359

360-
const destTokens = await route.rc.supportedDestinationTokens(
361-
token,
362-
fromContext,
363-
toContext,
364-
);
365-
366-
return destTokens.length > 0;
360+
try {
361+
const destTokens = await route.rc.supportedDestinationTokens(
362+
token,
363+
fromContext,
364+
toContext,
365+
);
366+
367+
return destTokens.length > 0;
368+
} catch (e) {
369+
return false;
370+
}
367371
};
368372

369373
const [isManualSupported, isAutomaticSupported, isM0Supported] =

0 commit comments

Comments
 (0)
Please sign in to comment.