From 8304bca71c18fc8c58ee08fce3a4587f07f52824 Mon Sep 17 00:00:00 2001 From: laurenspriem Date: Mon, 4 Aug 2025 14:19:04 +0530 Subject: [PATCH] empty list error --- .../lib/ui/viewer/people/person_gallery_suggestion.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mobile/apps/photos/lib/ui/viewer/people/person_gallery_suggestion.dart b/mobile/apps/photos/lib/ui/viewer/people/person_gallery_suggestion.dart index 7311e81de5..854c69e4c0 100644 --- a/mobile/apps/photos/lib/ui/viewer/people/person_gallery_suggestion.dart +++ b/mobile/apps/photos/lib/ui/viewer/people/person_gallery_suggestion.dart @@ -101,7 +101,9 @@ class _PersonGallerySuggestionState extends State } else { suggestions = await ClusterFeedbackService.instance .getAllLargePersonSuggestions(); - person = suggestions.first.person; + if (suggestions.isNotEmpty) { + person = suggestions.first.person; + } } if (suggestions.isNotEmpty && mounted) {