From e7025a963d5e92ce667e7a21e739f82e8402fca0 Mon Sep 17 00:00:00 2001 From: Santtu Pajukanta Date: Sat, 28 Sep 2024 12:32:42 +0300 Subject: [PATCH] fix(PictureView): attribute access on undefined location.state --- frontend/src/components/PictureView/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/PictureView/index.tsx b/frontend/src/components/PictureView/index.tsx index a8ee3b5..e71f019 100644 --- a/frontend/src/components/PictureView/index.tsx +++ b/frontend/src/components/PictureView/index.tsx @@ -133,7 +133,7 @@ function PictureView({ album, picture, fromAlbumView, history }: PictureViewProp preloadPreviousAndNext(picture); document.addEventListener('keydown', onKeyDown); - if ((history.location.state as any).slideshow) { + if ((history.location.state as any)?.slideshow) { startSlideshow(); }