Fix exception when counting with empty file list

This commit is contained in:
Ming Ming 2022-12-03 10:44:55 +08:00
parent 98696b9a47
commit 82cdd8b6a1

View file

@ -516,6 +516,9 @@ extension SqliteDbExtension on SqliteDb {
required List<int> fileIds,
}) async {
assert((sqlAccount != null) != (appAccount != null));
if (fileIds.isEmpty) {
return 0;
}
final counts = await fileIds.withPartition((sublist) async {
final count = countAll(
filter: