aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-01-16 22:12:56 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-01-17 16:25:53 +0800
commit4da0bbd6898436255b87ffb63fdcf775f56e5a2c (patch)
treeb1af08a65a575902254c1e6a3df26c4d09fc0f23 /libempathy-gtk
parent6e04fce7fe6049e84942dcbd0b91fc44563ba116 (diff)
downloadgsoc2013-empathy-4da0bbd6898436255b87ffb63fdcf775f56e5a2c.tar
gsoc2013-empathy-4da0bbd6898436255b87ffb63fdcf775f56e5a2c.tar.gz
gsoc2013-empathy-4da0bbd6898436255b87ffb63fdcf775f56e5a2c.tar.bz2
gsoc2013-empathy-4da0bbd6898436255b87ffb63fdcf775f56e5a2c.tar.lz
gsoc2013-empathy-4da0bbd6898436255b87ffb63fdcf775f56e5a2c.tar.xz
gsoc2013-empathy-4da0bbd6898436255b87ffb63fdcf775f56e5a2c.tar.zst
gsoc2013-empathy-4da0bbd6898436255b87ffb63fdcf775f56e5a2c.zip
empathy_pixbuf_avatar_from_individual_scaled_async: set an error if no avatar
It's fair for the caller to expect the error the be set if the _finish() function returns NULL. https://bugzilla.gnome.org/show_bug.cgi?id=667037
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-ui-utils.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 4d6168745..f3761e5cd 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -718,26 +718,25 @@ empathy_pixbuf_avatar_from_individual_scaled_async (
avatar_icon =
folks_avatar_details_get_avatar (FOLKS_AVATAR_DETAILS (individual));
- if (avatar_icon == NULL)
- goto out;
+ if (avatar_icon == NULL) {
+ g_simple_async_result_set_error (result, TP_ERRORS,
+ TP_ERROR_INVALID_ARGUMENT, "no avatar found");
+
+ g_simple_async_result_complete (result);
+ g_object_unref (result);
+ return;
+ }
closure = pixbuf_avatar_from_individual_closure_new (individual, result,
width, height,
cancellable);
- if (closure == NULL)
- goto out;
+
+ g_return_if_fail (closure != NULL);
g_loadable_icon_load_async (avatar_icon, width, cancellable,
avatar_icon_load_cb, closure);
g_object_unref (result);
-
- return;
-
-out:
- g_simple_async_result_set_op_res_gpointer (result, NULL, NULL);
- g_simple_async_result_complete (result);
- g_object_unref (result);
}
/* Return a ref on the GdkPixbuf */