diff --git a/lib/hooks/use-cosmoz-image-viewer.js b/lib/hooks/use-cosmoz-image-viewer.js index a1c3d1e..eb787ef 100644 --- a/lib/hooks/use-cosmoz-image-viewer.js +++ b/lib/hooks/use-cosmoz-image-viewer.js @@ -75,7 +75,7 @@ const onImageError = (e) => { ), { slide, next, prev, goto, index, first, last } = useSlideList(images, { loop, - initial: images[host.currentImageIndex], + initial: images?.[host.currentImageIndex], render: (image) => render({ src$: _invoke(image),