Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Add empty check

laurenspriem3d6106c1c117
diff --git a/mobile/lib/services/machine_learning/face_ml/person/person_service.dart b/mobile/lib/services/machine_learning/face_ml/person/person_service.dart
index 0fa86e174f..8dff6c99a0 100644
--- a/mobile/lib/services/machine_learning/face_ml/person/person_service.dart
+++ b/mobile/lib/services/machine_learning/face_ml/person/person_service.dart
@@ -285,7 +285,10 @@ class PersonService {
bool shouldCheckRejectedFaces = false;
for (var e in entities) {
final personData = PersonData.fromJson(json.decode(e.data));
- if (personData.rejectedFaceIDs != null) shouldCheckRejectedFaces = true;
+ if (personData.rejectedFaceIDs != null &&
+ personData.rejectedFaceIDs!.isNotEmpty) {
+ shouldCheckRejectedFaces = true;
+ }
int faceCount = 0;
// Locally store the assignment of faces to clusters and people
@@ -324,7 +327,8 @@ class PersonService {
await faceMLDataDB.getPersonToClusterIdToFaceIds();
for (var e in entities) {
final personData = PersonData.fromJson(json.decode(e.data));
- if (personData.rejectedFaceIDs != null) {
+ if (personData.rejectedFaceIDs != null &&
+ personData.rejectedFaceIDs!.isNotEmpty) {
final personFaceIDs =
dbPeopleClusterInfo[e.id]!.values.expand((e) => e).toSet();
final rejectedFaceIDsSet = personData.rejectedFaceIDs!.toSet();