From b149cceda01318d04195fc2196c29c5d9f67cda0 Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Fri, 13 Oct 2017 16:34:28 -0400 Subject: [PATCH] Fix exception thrown when tokens is null (#2355) --- ui/app/components/token-list.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/app/components/token-list.js b/ui/app/components/token-list.js index fb11be826..4959f1cd5 100644 --- a/ui/app/components/token-list.js +++ b/ui/app/components/token-list.js @@ -141,7 +141,8 @@ TokenList.prototype.componentDidUpdate = function (nextProps) { const sameUserAndNetwork = oldAddress === newAddress && oldNet === newNet const shouldUpdateTokens = isLoading || missingInfo || sameUserAndNetwork - const tokensLengthUnchanged = tokens.length === newTokens.length + const oldTokensLength = tokens ? tokens.length : 0 + const tokensLengthUnchanged = oldTokensLength === newTokens.length if (tokensLengthUnchanged && shouldUpdateTokens) return