From b602a133c2af49985742347608d73b508af97a3b Mon Sep 17 00:00:00 2001 From: Niranjana Binoy <43930900+NiranjanaBinoy@users.noreply.github.com> Date: Thu, 15 Dec 2022 19:17:05 -0500 Subject: [PATCH] updating the undefined check --- packages/assets-controllers/src/TokensController.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/assets-controllers/src/TokensController.ts b/packages/assets-controllers/src/TokensController.ts index 19272398b6..62d5b28f5a 100644 --- a/packages/assets-controllers/src/TokensController.ts +++ b/packages/assets-controllers/src/TokensController.ts @@ -743,7 +743,7 @@ export class TokensController extends BaseController< let newAllTokens = allTokens; if ( newTokens?.length || - (newTokens !== undefined && + (newTokens && allTokens && allTokens[chainIdToAddTokens] && allTokens[chainIdToAddTokens][userAddressToAddTokens]) @@ -762,7 +762,7 @@ export class TokensController extends BaseController< let newAllIgnoredTokens = allIgnoredTokens; if ( newIgnoredTokens?.length || - (newIgnoredTokens !== undefined && + (newIgnoredTokens && allIgnoredTokens && allIgnoredTokens[chainIdToAddTokens] && allIgnoredTokens[chainIdToAddTokens][userAddressToAddTokens]) @@ -781,7 +781,7 @@ export class TokensController extends BaseController< let newAllDetectedTokens = allDetectedTokens; if ( newDetectedTokens?.length || - (newDetectedTokens !== undefined && + (newDetectedTokens && allDetectedTokens && allDetectedTokens[chainIdToAddTokens] && allDetectedTokens[chainIdToAddTokens][userAddressToAddTokens])