[calls] contacts-provider: Don't throw a critical when trying to lookup NULL id
- From: Evangelos Ribeiro Tzaras <devrtz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [calls] contacts-provider: Don't throw a critical when trying to lookup NULL id
- Date: Tue, 22 Feb 2022 09:30:39 +0000 (UTC)
commit 9ffcbe2de8ce4a079c2761c3c9e3cf32e5099aa7
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date: Thu Feb 17 11:08:41 2022 +0100
contacts-provider: Don't throw a critical when trying to lookup NULL id
Anonymous callers will show up with a NULL id, so don't emit a critical here.
Fixes 006673a9e1a18d5a4ddbf4ad2bd04b935396ac2a
src/calls-contacts-provider.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/calls-contacts-provider.c b/src/calls-contacts-provider.c
index 41faeb2c..5bd1818d 100644
--- a/src/calls-contacts-provider.c
+++ b/src/calls-contacts-provider.c
@@ -441,7 +441,9 @@ calls_contacts_provider_lookup_id (CallsContactsProvider *self,
g_autoptr (CallsBestMatch) best_match = NULL;
g_return_val_if_fail (CALLS_IS_CONTACTS_PROVIDER (self), NULL);
- g_return_val_if_fail (id, NULL);
+
+ if (!id || !*id)
+ return NULL;
best_match = g_hash_table_lookup (self->best_matches, id);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]