fix: prevent to loop on keys of object profile pictures when It's not loaded yet (#2658)

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

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
This commit is contained in:
Cristhian Zanforlin Lousa 2024-07-12 14:43:24 -03:00 committed by GitHub
commit cdb8c80a7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,7 +21,7 @@ const usePreloadImages = (
};
useEffect(() => {
if (loading) return;
if (loading || !profilePictures) return;
const imageArray: string[] = [];
Object.keys(profilePictures).flatMap((folder) =>