Skip to content

Commit

Permalink
Merge pull request #181 from SnickerdoodleLabs/fix/null-metadata
Browse files Browse the repository at this point in the history
fix: null metadata check
  • Loading branch information
moahammadalt authored Aug 11, 2022
2 parents ae3671c + ce9c24a commit 8ebd327
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ const NFTItem: FC<INFTItemProps> = ({ item }: INFTItemProps) => {
const regexpImage = /(\"image.*?\":\s*?\"(\s*?.*?\s*?)\")/;
const regexpUrl =
/(https?|ipfs):\/\/([-A-Z0-9.]+)(\/[-A-Z0-9+&@#\/%=~_|!:,.;]*)/i;
const splittedData = item.metadata.split(regexpImage);
const splittedData = item.metadata?.split(regexpImage);
const extractedImages: string[] = [];
splittedData.forEach((key) => {
splittedData?.forEach((key) => {
if (regexpImage.test(key)) {
const imageUrl = key.match(regexpImage)?.[2];
if (imageUrl && regexpUrl.test(imageUrl)) {
Expand Down

0 comments on commit 8ebd327

Please sign in to comment.