mirror of
https://github.com/wgh136/nysoure.git
synced 2025-12-15 23:41:16 +00:00
fix: handle case where images array is undefined in Gallery component
This commit is contained in:
@@ -2074,7 +2074,7 @@ function Gallery({ images, nsfw }: { images: number[], nsfw: number[] }) {
|
||||
|
||||
// 预加载下一张图片
|
||||
useEffect(() => {
|
||||
if (images.length <= 1) return;
|
||||
if (!images || images.length <= 1) return;
|
||||
|
||||
const nextIndex = (currentIndex + 1) % images.length;
|
||||
const nextImageUrl = network.getImageUrl(images[nextIndex]);
|
||||
|
||||
Reference in New Issue
Block a user