Commit 4da0bbd6 authored by Guillaume Desmottes's avatar Guillaume Desmottes

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
parent 6e04fce7
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment