diff --git a/src/state/lists/hooks.ts b/src/state/lists/hooks.ts index a558b5ec..40c095ac 100644 --- a/src/state/lists/hooks.ts +++ b/src/state/lists/hooks.ts @@ -159,7 +159,7 @@ export function listToTokenMap(list: TokenList): TokenAddressMap { }) ?.filter((x): x is TagInfo => Boolean(x)) ?? [] const token = new WrappedTokenInfo(tokenInfo, tags) - if (tokenMap[token.chainId][token.address] !== undefined) throw Error('Duplicate tokens.') + if (tokenMap?.[token.chainId]?.[token.address] !== undefined) throw Error('Duplicate tokens.') return { ...tokenMap, [token.chainId]: {