[calls] record-row: Avoid raising critical



commit 134c4af9c7bedc59e43a771b795c7dd9e0df0336
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date:   Fri Mar 4 10:39:11 2022 +0100

    record-row: Avoid raising critical
    
    When the record has a NULL id there won't be a CallsBestMatch we can use to bind
    properties.

 src/calls-call-record-row.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/calls-call-record-row.c b/src/calls-call-record-row.c
index 4a1024d4..013d285d 100644
--- a/src/calls-call-record-row.c
+++ b/src/calls-call-record-row.c
@@ -294,11 +294,16 @@ on_notify_can_add_contacts (CallsCallRecordRow *self)
   if (!calls_contacts_provider_get_can_add_contacts (contacts_provider))
     return;
 
+  g_signal_handlers_disconnect_by_data(contacts_provider, self);
+
+  /* The record has a NULL id */
+  if (!self->contact)
+    return;
+
   g_object_bind_property (self->contact, "has-individual",
                           action_new_contact, "enabled",
                           G_BINDING_SYNC_CREATE |
                           G_BINDING_INVERT_BOOLEAN);
-  g_signal_handlers_disconnect_by_data(contacts_provider, self);
 }
 
 


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