[gnome-contacts] FakePersonaStore: Make sure the Postal Address isn't empty before submitting it to Folks



commit 42e80694f6844671c61c5266fd77ca36e3fd1ca1
Author: Alaric Senat <asenat student 42 fr>
Date:   Thu Sep 3 17:14:12 2020 +0200

    FakePersonaStore: Make sure the Postal Address isn't empty before submitting it to Folks

 src/contacts-fake-persona-store.vala | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/src/contacts-fake-persona-store.vala b/src/contacts-fake-persona-store.vala
index 8891a934..ca6836b5 100644
--- a/src/contacts-fake-persona-store.vala
+++ b/src/contacts-fake-persona-store.vala
@@ -474,8 +474,7 @@ PostalAddressDetails
         var original = (Set<PostalAddressFieldDetails>) new_value;
         var copy = new HashSet<PostalAddressFieldDetails> ();
         foreach (var e in original) {
-          // TODO: make sure that the Postal Address isn't empty
-          if (e.value != null)
+          if (e.value != null && !e.value.is_empty ())
             copy.add (new PostalAddressFieldDetails (e.value, e.parameters));
         }
         yield ((PostalAddressDetails) persona).change_postal_addresses (copy);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]