Skip to content

Commit

Permalink
Merge pull request #6378 from kodadot/hotfix/-insufficent-null-check-…
Browse files Browse the repository at this point in the history
…when-getting-nft-attributes

🔧 getProcessMetadata (useNft)
  • Loading branch information
daiagi authored Jul 3, 2023
2 parents 36124e1 + 1e4c54a commit 5414faa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions composables/useNft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ async function getProcessMetadata(nft: NFTWithMetadata) {
const getAttributes = () => {
const hasMetadataAttributes =
metadata.attributes && metadata.attributes.length > 0
const hasEmptyNftAttributes =
nft.meta.attributes && nft.meta.attributes.length === 0
const attr = nft?.meta?.attributes || []
const hasEmptyNftAttributes = attr.length === 0

return hasMetadataAttributes && hasEmptyNftAttributes
? metadata.attributes
: nft.meta.attributes || []
: attr
}

return {
Expand Down

0 comments on commit 5414faa

Please sign in to comment.