Skip to content

Commit

Permalink
fix: prevent to loop on keys of object profile pictures when It's not…
Browse files Browse the repository at this point in the history
… loaded yet (#2658)

🐛 (use-preload-images.tsx): add null check for profilePictures to prevent errors when profilePictures is undefined

Co-authored-by: anovazzi1 <[email protected]>
  • Loading branch information
Cristhianzl and anovazzi1 authored Jul 12, 2024
1 parent 6bc0766 commit cdb8c80
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const usePreloadImages = (
};

useEffect(() => {
if (loading) return;
if (loading || !profilePictures) return;
const imageArray: string[] = [];

Object.keys(profilePictures).flatMap((folder) =>
Expand Down

0 comments on commit cdb8c80

Please sign in to comment.