From fc3b035aac66c5636ef7d77c0659a157cdf4384d Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Tue, 23 Jul 2019 17:14:04 -0230 Subject: [PATCH] Check balance before testing it w/ isZero (#6898) --- app/scripts/controllers/detect-tokens.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scripts/controllers/detect-tokens.js b/app/scripts/controllers/detect-tokens.js index e6940c613..f0ceab8e6 100644 --- a/app/scripts/controllers/detect-tokens.js +++ b/app/scripts/controllers/detect-tokens.js @@ -47,7 +47,7 @@ class DetectTokensController { } tokensToDetect.forEach((tokenAddress, index) => { const balance = result[index] - if (!balance.isZero()) { + if (balance && !balance.isZero()) { this._preferences.addToken(tokenAddress, contracts[tokenAddress].symbol, contracts[tokenAddress].decimals) } })