metaplex-foundation / mpl-token-metadata

Program to attach additional data to Fungible or Non-Fungible tokens on Solana.
https://developers.metaplex.com/token-metadata
Other
98 stars 42 forks source link

PoC: fix safeFetchAllMetadata throwing if facing broken token metadata #117

Open xdzurman opened 2 months ago

xdzurman commented 2 months ago

This crash occurred on this token address https://solscan.io/account/2sa9fYymwbkBR5PprEwXrWxPNj9oyRuPj6CbTmtweWFH, which was calculated as PDA of this token mint https://solscan.io/token/DBMjxi1vNNWkkDro9UFYxd5qdzf1T48TK6CBy5FSZw6F.

I added an optional flag to the options, which upon passing skipCorruptedMetadata would try-catch the deserialization part of the function, which could throw.