diff --git a/packages/assets-controllers/src/NftDetectionController.ts b/packages/assets-controllers/src/NftDetectionController.ts index ab92a3094c..f79dd52d8f 100644 --- a/packages/assets-controllers/src/NftDetectionController.ts +++ b/packages/assets-controllers/src/NftDetectionController.ts @@ -668,9 +668,7 @@ export class NftDetectionController extends BaseController< singleNFT.token = { ...singleNFT.token, collection: { - ...(singleNFT.token.collection - ? singleNFT.token.collection - : {}), + ...(singleNFT.token.collection ?? {}), creator: found?.creator, openseaVerificationStatus: found?.openseaVerificationStatus, contractDeployedAt: found.contractDeployedAt, diff --git a/packages/assets-controllers/src/assetsUtil.ts b/packages/assets-controllers/src/assetsUtil.ts index 55a0828570..6105a18095 100644 --- a/packages/assets-controllers/src/assetsUtil.ts +++ b/packages/assets-controllers/src/assetsUtil.ts @@ -58,8 +58,8 @@ export function hasNewCollectionFields( newNftMetadata: NftMetadata, nft: Nft, ): boolean { - const keysNewNftMetadata = Object.keys(newNftMetadata.collection || {}); - const keysExistingNft = new Set(Object.keys(nft.collection || {})); + const keysNewNftMetadata = Object.keys(newNftMetadata.collection ?? {}); + const keysExistingNft = new Set(Object.keys(nft.collection ?? {})); return keysNewNftMetadata.some((key) => !keysExistingNft.has(key)); }