From abffb55ddd0edd6134a6f524a4b431e9d7083cad Mon Sep 17 00:00:00 2001 From: james-a-morris Date: Fri, 6 Sep 2024 17:04:56 -0400 Subject: [PATCH] chore: allow for backup if env are malformed Signed-off-by: james-a-morris --- api/limits.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/api/limits.ts b/api/limits.ts index 992a19770..e10d3a2f4 100644 --- a/api/limits.ts +++ b/api/limits.ts @@ -85,15 +85,12 @@ const handler = async ( outputToken, } = validateChainAndTokenParams(query); - const minDepositUsdForDestinationChainId = Number( - process.env[`MIN_DEPOSIT_USD_${destinationChainId}`] ?? - MIN_DEPOSIT_USD ?? - 0 - ); - console.log( - `minDepositUsdForDestinationChainId:`, - minDepositUsdForDestinationChainId + let minDepositUsdForDestinationChainId = Number( + process.env[`MIN_DEPOSIT_USD_${destinationChainId}`] ?? MIN_DEPOSIT_USD ); + if (isNaN(minDepositUsdForDestinationChainId)) { + minDepositUsdForDestinationChainId = 0; + } const hubPool = getHubPool(provider); const configStoreClient = new sdk.contracts.acrossConfigStore.Client(