[gnome-contacts] editor: Don't use null properties



commit 1ca616dd3285a843f6bd46730d62f003d01db13f
Author: Niels De Graef <ndegraef redhat com>
Date:   Thu Sep 29 11:37:47 2022 +0200

    editor: Don't use null properties
    
    Since we had to add an explicit null-terminator for Vala, we have to
    make sure we guard against it in our code .

 src/contacts-contact-editor.vala | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/contacts-contact-editor.vala b/src/contacts-contact-editor.vala
index f3f20f25..80b5d353 100644
--- a/src/contacts-contact-editor.vala
+++ b/src/contacts-contact-editor.vala
@@ -242,6 +242,9 @@ public class Contacts.PersonaEditor : Gtk.Widget {
       writeable_props = persona.writeable_properties;
 
     foreach (unowned var prop in writeable_props) {
+      if (prop == null) // Oh Vala
+          continue;
+
       if (contact.get_most_relevant_chunk (prop, true) == null) {
         contact.create_chunk (prop, persona);
       }


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