Skip to content

Commit

Permalink
fix(mobile): assetList is empty (immich-app#4213)
Browse files Browse the repository at this point in the history
* fix(mobile): assetList is empty

* add comments

---------

Co-authored-by: Alex <[email protected]>
  • Loading branch information
fujie-xiyou and alextran1502 authored Sep 25, 2023
1 parent 3bef456 commit c0ce81c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mobile/lib/modules/backup/providers/backup.provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ class BackupNotifier extends StateNotifier<BackUpState> {
final assetCountInAlbum = await album.assetCountAsync;
if (assetCountInAlbum > 0) {
final assetList = await album.getAssetListPaged(page: 0, size: 1);

// Even though we check assetCountInAlbum to make sure that there are assets in album
// The `getAssetListPaged` method still return empty list and cause not assets get rendered
if (assetList.isEmpty) {
continue;
}
final thumbnailAsset = assetList.first;
try {
final thumbnailData = await thumbnailAsset
Expand Down

0 comments on commit c0ce81c

Please sign in to comment.