aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-ui-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy-gtk/empathy-ui-utils.c')
-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 */