aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-ui-utils.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-11-30 19:55:29 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-11-30 19:55:31 +0800
commitbc690f37e7b0a49258b505653dd0cb94ffa48056 (patch)
tree4d4af0b9318135175717fb912675abd0a6ec7513 /libempathy-gtk/empathy-ui-utils.c
parentbbe74c7f743b9210a905c74864a9b5d33ad48a87 (diff)
downloadgsoc2013-empathy-bc690f37e7b0a49258b505653dd0cb94ffa48056.tar
gsoc2013-empathy-bc690f37e7b0a49258b505653dd0cb94ffa48056.tar.gz
gsoc2013-empathy-bc690f37e7b0a49258b505653dd0cb94ffa48056.tar.bz2
gsoc2013-empathy-bc690f37e7b0a49258b505653dd0cb94ffa48056.tar.lz
gsoc2013-empathy-bc690f37e7b0a49258b505653dd0cb94ffa48056.tar.xz
gsoc2013-empathy-bc690f37e7b0a49258b505653dd0cb94ffa48056.tar.zst
gsoc2013-empathy-bc690f37e7b0a49258b505653dd0cb94ffa48056.zip
ui-utils: don't expect that cancellable is not NULL
cancellable are always optional so this code should be NULL safe.
Diffstat (limited to 'libempathy-gtk/empathy-ui-utils.c')
-rw-r--r--libempathy-gtk/empathy-ui-utils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index a387160d3..f354980a1 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -552,7 +552,8 @@ pixbuf_avatar_from_individual_closure_new (FolksIndividual *individual,
closure->result = g_object_ref (result);
closure->width = width;
closure->height = height;
- closure->cancellable = g_object_ref (cancellable);
+ if (cancellable != NULL)
+ closure->cancellable = g_object_ref (cancellable);
return closure;
}
@@ -561,7 +562,7 @@ static void
pixbuf_avatar_from_individual_closure_free (
PixbufAvatarFromIndividualClosure *closure)
{
- g_object_unref (closure->cancellable);
+ g_clear_object (&closure->cancellable);
tp_clear_object (&closure->loader);
g_object_unref (closure->individual);
g_object_unref (closure->result);