Skip to content

Commit

Permalink
handle url==undefined error
Browse files Browse the repository at this point in the history
  • Loading branch information
iskysun96 committed Jan 24, 2024
1 parent e223aff commit 52085fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Gallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Gallery = () => {

for (const balance of balances) {
const assetInfo = await algodClient.getAssetByID(balance['asset-id']).do()
if (assetInfo.params['unit-name'] === undefined) {
if (assetInfo.params['unit-name'] === undefined || assetInfo.params['url'] === 'ipfs://undefined/#arc3') {
continue
}

Expand Down Expand Up @@ -63,6 +63,7 @@ const Gallery = () => {
if (assets === undefined) {
return
}
console.log(assets)
setDiaryAssets(assets)
} catch (error) {
console.error('Error fetching assets:', error)
Expand Down

0 comments on commit 52085fa

Please sign in to comment.