LocalSync: Handle empty album
This commit is contained in:
parent
162d1ab658
commit
ddf8b6438e
1 changed files with 2 additions and 2 deletions
|
@ -70,12 +70,12 @@ Future<List<Tuple2<AssetPathEntity, String>>>
|
||||||
const OrderOption(type: OrderOptionType.createDate, asc: false),
|
const OrderOption(type: OrderOptionType.createDate, asc: false),
|
||||||
);
|
);
|
||||||
for (AssetPathEntity pathEntity in pathEntities) {
|
for (AssetPathEntity pathEntity in pathEntities) {
|
||||||
//todo: test and handle empty album case
|
|
||||||
final latestEntity = await pathEntity.getAssetListPaged(
|
final latestEntity = await pathEntity.getAssetListPaged(
|
||||||
page: 0,
|
page: 0,
|
||||||
size: 1,
|
size: 1,
|
||||||
);
|
);
|
||||||
final String localCoverID = latestEntity.first.id;
|
final String localCoverID =
|
||||||
|
latestEntity.isEmpty ? '' : latestEntity.first.id;
|
||||||
result.add(Tuple2(pathEntity, localCoverID));
|
result.add(Tuple2(pathEntity, localCoverID));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Add table
Reference in a new issue