diff --git a/mobile/lib/providers/backup/backup.provider.dart b/mobile/lib/providers/backup/backup.provider.dart index 6568943722..ab869c2328 100644 --- a/mobile/lib/providers/backup/backup.provider.dart +++ b/mobile/lib/providers/backup/backup.provider.dart @@ -294,17 +294,29 @@ class BackupNotifier extends StateNotifier { final Set assetsFromExcludedAlbums = {}; for (final album in state.selectedBackupAlbums) { + final assetCount = await album.albumEntity.assetCountAsync; + + if (assetCount == 0) { + continue; + } + final assets = await album.albumEntity.getAssetListRange( start: 0, - end: await album.albumEntity.assetCountAsync, + end: assetCount, ); assetsFromSelectedAlbums.addAll(assets); } for (final album in state.excludedBackupAlbums) { + final assetCount = await album.albumEntity.assetCountAsync; + + if (assetCount == 0) { + continue; + } + final assets = await album.albumEntity.getAssetListRange( start: 0, - end: await album.albumEntity.assetCountAsync, + end: assetCount, ); assetsFromExcludedAlbums.addAll(assets); }