From 2e8bc3536f75dc015937eca7bb4bd6f8198123c4 Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Wed, 15 Oct 2025 16:29:51 +1100 Subject: [PATCH] Null check image visual_files (#6136) --- ui/v2.5/src/components/Galleries/GalleryViewer.tsx | 4 ++-- ui/v2.5/src/components/Images/ImageList.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/v2.5/src/components/Galleries/GalleryViewer.tsx b/ui/v2.5/src/components/Galleries/GalleryViewer.tsx index 7ebb679fd..f570f9990 100644 --- a/ui/v2.5/src/components/Galleries/GalleryViewer.tsx +++ b/ui/v2.5/src/components/Galleries/GalleryViewer.tsx @@ -67,8 +67,8 @@ export const GalleryViewer: React.FC = ({ galleryId }) => { images.forEach((image, index) => { let imageData = { src: image.paths.thumbnail!, - width: image.visual_files[0].width, - height: image.visual_files[0].height, + width: image.visual_files[0]?.width ?? 0, + height: image.visual_files[0]?.height ?? 0, tabIndex: index, key: image.id ?? index, loading: "lazy", diff --git a/ui/v2.5/src/components/Images/ImageList.tsx b/ui/v2.5/src/components/Images/ImageList.tsx index 4149970b5..093567613 100644 --- a/ui/v2.5/src/components/Images/ImageList.tsx +++ b/ui/v2.5/src/components/Images/ImageList.tsx @@ -72,8 +72,8 @@ const ImageWall: React.FC = ({ image.paths.preview != "" ? image.paths.preview! : image.paths.thumbnail!, - width: image.visual_files[0].width, - height: image.visual_files[0].height, + width: image.visual_files?.[0]?.width ?? 0, + height: image.visual_files?.[0]?.height ?? 0, tabIndex: index, key: image.id, loading: "lazy",