Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix: handle range error when all memories are deleted and FullScreenMemory screen is popped

ashilknf143f90ec0e1
diff --git a/lib/ui/home/memories/memory_cover_widget.dart b/lib/ui/home/memories/memory_cover_widget.dart
index 1be67f8dd4..df1b6d5b38 100644
--- a/lib/ui/home/memories/memory_cover_widget.dart
+++ b/lib/ui/home/memories/memory_cover_widget.dart
@@ -21,6 +21,11 @@ class MemoryCovertWidget extends StatefulWidget {
class _MemoryCovertWidgetState extends State<MemoryCovertWidget> {
@override
Widget build(BuildContext context) {
+ //memories will be empty if all memories are deleted and setState is called
+ //after FullScreenMemory screen is popped
+ if (widget.memories.isEmpty) {
+ return const SizedBox.shrink();
+ }
final index = _getNextMemoryIndex();
final title = _getTitle(widget.memories[index]);
return GestureDetector(