fix(ui): fix crash when removing last image

This commit is contained in:
psychedelicious 2023-07-21 15:57:09 +10:00
parent eab18c7385
commit fe33acedad

View File

@ -52,8 +52,8 @@ export const nextPrevImageButtonsSelector = createSelector(
const prevImageIndex = clamp(currentImageIndex - 1, 0, images.length - 1); const prevImageIndex = clamp(currentImageIndex - 1, 0, images.length - 1);
const nextImageId = images[nextImageIndex].image_name; const nextImageId = images[nextImageIndex]?.image_name;
const prevImageId = images[prevImageIndex].image_name; const prevImageId = images[prevImageIndex]?.image_name;
const nextImage = selectors.selectById(data, nextImageId); const nextImage = selectors.selectById(data, nextImageId);
const prevImage = selectors.selectById(data, prevImageId); const prevImage = selectors.selectById(data, prevImageId);