Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fix out of range issue

laurenspriema99cdbedc499
diff --git a/mobile/lib/services/smart_memories_service.dart b/mobile/lib/services/smart_memories_service.dart
index fd2874c77d..b17fbbe4a4 100644
--- a/mobile/lib/services/smart_memories_service.dart
+++ b/mobile/lib/services/smart_memories_service.dart
@@ -738,7 +738,7 @@ class SmartMemoriesService {
'Something is going wrong, ${potentialMemory.peopleMemoryType} has multiple memories for same person',
);
} else {
- final randIdx = Random().nextInt(potentialMemory.memories.length);
+ final randIdx = Random().nextInt(memoriesForCategory.length);
potentialMemory = memoriesForCategory[randIdx];
}
}