From 21666fc7d46be3aee961f1d63b2dc39b7193dbae Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Mon, 12 Apr 2021 13:58:11 +0200 Subject: [PATCH] best-match: Don't set NULL phone numbers when updating country code Also related to #255 --- src/calls-best-match.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/calls-best-match.c b/src/calls-best-match.c index 547b814..49499de 100644 --- a/src/calls-best-match.c +++ b/src/calls-best-match.c @@ -142,10 +142,13 @@ set_property (GObject *object, case PROP_COUNTRY_CODE: country_code = g_value_get_string (value); if (country_code) { - g_autofree gchar *number = g_strdup (self->phone_number); g_free (self->country_code); self->country_code = g_strdup (country_code); - calls_best_match_set_phone_number (self, number); + + if (self->phone_number) { + g_autofree gchar *number = g_strdup (self->phone_number); + calls_best_match_set_phone_number (self, number); + } } break;