diff --git a/lib/ui/gallery.dart b/lib/ui/gallery.dart index 653c42754..abb718aa6 100644 --- a/lib/ui/gallery.dart +++ b/lib/ui/gallery.dart @@ -133,7 +133,7 @@ class _GalleryState extends State { void _deduplicatePhotos() { for (int index = 1; index < _photos.length; index++) { final current = _photos[index], previous = _photos[index - 1]; - if (current.localId == previous.localId) { + if (current.localId != null && current.localId == previous.localId) { _photos.removeAt(index); index--; }