From 868d93216580a1267f42324476e21fa49d741a22 Mon Sep 17 00:00:00 2001 From: Daniel <80175477+dan437@users.noreply.github.com> Date: Mon, 26 Jul 2021 10:15:13 +0200 Subject: [PATCH] Check for the "fromToken" existance before checking decimals (#11606) --- ui/pages/swaps/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/pages/swaps/index.js b/ui/pages/swaps/index.js index 8c7c7a6cf..45f6eb14a 100644 --- a/ui/pages/swaps/index.js +++ b/ui/pages/swaps/index.js @@ -298,7 +298,8 @@ export default function Swap() { // "setBalanceError" is just a warning, a user can still click on the "Review Swap" button. dispatch(setBalanceError(balanceError)); setTokenFromError( - countDecimals(newInputValue) > fromToken.decimals + fromToken && + countDecimals(newInputValue) > fromToken.decimals ? 'tooManyDecimals' : null, );