From 134c4af9c7bedc59e43a771b795c7dd9e0df0336 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Fri, 4 Mar 2022 10:39:11 +0100 Subject: [PATCH] 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 4a1024d..013d285 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); }