1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Check for the "fromToken" existance before checking decimals (#11606)

This commit is contained in:
Daniel 2021-07-26 10:15:13 +02:00 committed by GitHub
parent 5d92836c8c
commit 868d932165
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,
);