diff --git a/lib/ui/remote_folder_gallery_widget.dart b/lib/ui/remote_folder_gallery_widget.dart index e5df2c035..76b17199e 100644 --- a/lib/ui/remote_folder_gallery_widget.dart +++ b/lib/ui/remote_folder_gallery_widget.dart @@ -61,8 +61,12 @@ class _RemoteFolderGalleryWidgetState extends State { Future> _getRemoteFolders() async { final folders = await FolderDB.instance.getFolders(); for (final folder in folders) { - folder.thumbnailPhoto = - await PhotoDB.instance.getLatestPhotoInRemoteFolder(folder.id); + try { + folder.thumbnailPhoto = + await PhotoDB.instance.getLatestPhotoInRemoteFolder(folder.id); + } catch (e) { + _logger.warning(e.toString()); + } } return folders; } @@ -72,7 +76,10 @@ class _RemoteFolderGalleryWidgetState extends State { child: Column( children: [ Container( - child: ThumbnailWidget(folder.thumbnailPhoto), + child: folder.thumbnailPhoto == + null // When the user has shared a folder without photos + ? Icon(Icons.error) + : ThumbnailWidget(folder.thumbnailPhoto), height: 150, width: 150, ),