mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Null check image visual_files (#6136)
This commit is contained in:
@@ -67,8 +67,8 @@ export const GalleryViewer: React.FC<IProps> = ({ galleryId }) => {
|
|||||||
images.forEach((image, index) => {
|
images.forEach((image, index) => {
|
||||||
let imageData = {
|
let imageData = {
|
||||||
src: image.paths.thumbnail!,
|
src: image.paths.thumbnail!,
|
||||||
width: image.visual_files[0].width,
|
width: image.visual_files[0]?.width ?? 0,
|
||||||
height: image.visual_files[0].height,
|
height: image.visual_files[0]?.height ?? 0,
|
||||||
tabIndex: index,
|
tabIndex: index,
|
||||||
key: image.id ?? index,
|
key: image.id ?? index,
|
||||||
loading: "lazy",
|
loading: "lazy",
|
||||||
|
|||||||
@@ -72,8 +72,8 @@ const ImageWall: React.FC<IImageWallProps> = ({
|
|||||||
image.paths.preview != ""
|
image.paths.preview != ""
|
||||||
? image.paths.preview!
|
? image.paths.preview!
|
||||||
: image.paths.thumbnail!,
|
: image.paths.thumbnail!,
|
||||||
width: image.visual_files[0].width,
|
width: image.visual_files?.[0]?.width ?? 0,
|
||||||
height: image.visual_files[0].height,
|
height: image.visual_files?.[0]?.height ?? 0,
|
||||||
tabIndex: index,
|
tabIndex: index,
|
||||||
key: image.id,
|
key: image.id,
|
||||||
loading: "lazy",
|
loading: "lazy",
|
||||||
|
|||||||
Reference in New Issue
Block a user