summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-05-12 12:29:35 +0200
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-09-17 14:07:47 +0100
commit93202fe5ac36f495581f61649b2494cbc0bac7e7 (patch)
tree92d1baa4cce5331a00907aa452276a08be25b192
parent3552e853066cfedbc3f194b5f95f60a0733ba225 (diff)
downloadtelepathy-glib-93202fe5ac36f495581f61649b2494cbc0bac7e7.tar.gz
base-client: handle clients being NULL
May happen if tp_base_client_dup_handled_channels() is called before any client has been registered. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77882 Reviewed-by: Simon McVittie
-rw-r--r--telepathy-glib/base-client.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/telepathy-glib/base-client.c b/telepathy-glib/base-client.c
index 1643be178..767ddc2af 100644
--- a/telepathy-glib/base-client.c
+++ b/telepathy-glib/base-client.c
@@ -1062,9 +1062,11 @@ tp_base_client_dup_handled_channels (TpBaseClient *self)
g_return_val_if_fail (self->priv->flags & CLIENT_IS_HANDLER, NULL);
- set = g_hash_table_new (g_str_hash, g_str_equal);
-
clients = g_object_get_qdata (G_OBJECT (self->priv->dbus), clients_quark ());
+ if (clients == NULL)
+ return NULL;
+
+ set = g_hash_table_new (g_str_hash, g_str_equal);
g_hash_table_iter_init (&iter, clients);
while (g_hash_table_iter_next (&iter, NULL, &value))