1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 20:39:08 +01:00

Fix exception thrown when tokens is null (#2355)

This commit is contained in:
Alexander Tseung 2017-10-13 16:34:28 -04:00 committed by Daniel Tsui
parent a84014eff8
commit b149cceda0

View File

@ -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