From d67e690f33d7421c69ac102012eac14ce3f3320c Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Fri, 2 Apr 2021 09:56:58 +0200 Subject: [PATCH] new-call-box: Connect signals only if origins non-NULL Fixes #252 --- src/calls-new-call-box.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/calls-new-call-box.c b/src/calls-new-call-box.c index 2651183..7e4a894 100644 --- a/src/calls-new-call-box.c +++ b/src/calls-new-call-box.c @@ -209,11 +209,14 @@ provider_changed_cb (CallsNewCallBox *self) g_assert (CALLS_IS_NEW_CALL_BOX (self)); origins = calls_manager_get_origins (calls_manager_get_default ()); - g_signal_connect_object (origins, "items-changed", - G_CALLBACK (origin_count_changed_cb), self, - G_CONNECT_SWAPPED); + if (origins) + { + g_signal_connect_object (origins, "items-changed", + G_CALLBACK (origin_count_changed_cb), self, + G_CONNECT_SWAPPED); - origin_count_changed_cb (self); + origin_count_changed_cb (self); + } } static void