From 8ae90aec0e42e63fdb63460dc80ccb30a0ff4617 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Tue, 2 Nov 2021 05:53:12 -0230 Subject: [PATCH] Ensure exchange rate is stringified before passing to bignumber in confirm-token-transaction component (#12550) --- .../confirm-token-transaction-base.component.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/pages/confirm-token-transaction-base/confirm-token-transaction-base.component.js b/ui/pages/confirm-token-transaction-base/confirm-token-transaction-base.component.js index 90180b23e..83c08928e 100644 --- a/ui/pages/confirm-token-transaction-base/confirm-token-transaction-base.component.js +++ b/ui/pages/confirm-token-transaction-base/confirm-token-transaction-base.component.js @@ -35,7 +35,9 @@ export default function ConfirmTokenTransactionBase({ } const decimalEthValue = new BigNumber(tokenAmount) - .times(new BigNumber(contractExchangeRate)) + .times( + new BigNumber(contractExchangeRate ? String(contractExchangeRate) : 0), + ) .toFixed(); return getWeiHexFromDecimalValue({