Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix crash when opening file viewer before slide is ready

Anand Baburajan1aebb24ef9aa
diff --git a/web/packages/gallery/components/viewer/photoswipe.ts b/web/packages/gallery/components/viewer/photoswipe.ts
index 1a0e82d5de..c8f517e865 100644
--- a/web/packages/gallery/components/viewer/photoswipe.ts
+++ b/web/packages/gallery/components/viewer/photoswipe.ts
@@ -1517,6 +1517,9 @@ export class FileViewerPhotoSwipe {
const updateSocialButtonsVisibility = () => {
if (!actionButtonsEl) return;
+ // Guard: _currentAnnotatedFile can be undefined during
+ // initialization before the first slide is shown.
+ if (!_currentAnnotatedFile) return;
// Show buttons if: static showSocialButtons is true
// (public album) OR delegate says this file should
// show buttons (file in shared collection).