[telepathy-mission-control/master] McdConnection: get_all_requests_cb: don't segfault if Channels property doesn't exist

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Mar 27 12:29:30 PDT 2009


However buggy the other process is, we shouldn't crash.
---
 src/mcd-connection.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/mcd-connection.c b/src/mcd-connection.c
index ff2a163..887bed3 100644
--- a/src/mcd-connection.c
+++ b/src/mcd-connection.c
@@ -1375,6 +1375,14 @@ static void get_all_requests_cb (TpProxy *proxy, GHashTable *properties,
     }
 
     value = g_hash_table_lookup (properties, "Channels");
+
+    if (value == NULL)
+    {
+        g_warning ("%s: no Channels property on %s",
+                   G_STRFUNC, tp_proxy_get_object_path (proxy));
+        return;
+    }
+
     if (!G_VALUE_HOLDS (value, TP_ARRAY_TYPE_CHANNEL_DETAILS_LIST))
     {
         g_warning ("%s: property Channels has type %s, expecting %s",
-- 
1.5.6.5




More information about the telepathy-commits mailing list