From bc690f37e7b0a49258b505653dd0cb94ffa48056 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 30 Nov 2011 12:55:29 +0100 Subject: ui-utils: don't expect that cancellable is not NULL cancellable are always optional so this code should be NULL safe. --- libempathy-gtk/empathy-ui-utils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libempathy-gtk') 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); -- cgit v1.2.3