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:
parent
6bc0766929
commit
cdb8c80a7e
1 changed files with 1 additions and 1 deletions
|
|
@ -21,7 +21,7 @@ const usePreloadImages = (
|
|||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (loading) return;
|
||||
if (loading || !profilePictures) return;
|
||||
const imageArray: string[] = [];
|
||||
|
||||
Object.keys(profilePictures).flatMap((folder) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue