[evolution] EWebView: Make sure an error is set when passing it to webkit_uri_scheme_request_finish_error()



commit a1735638bfb1d546e9762df4f0d0c47fe4d715c3
Author: Milan Crha <mcrha redhat com>
Date:   Thu Oct 13 12:50:56 2022 +0200

    EWebView: Make sure an error is set when passing it to webkit_uri_scheme_request_finish_error()
    
    In case the content request fails, but does not set the GError,
    make sure any error is set, thus the webkit_uri_scheme_request_finish_error()
    can work properly.

 src/e-util/e-web-view.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/e-util/e-web-view.c b/src/e-util/e-web-view.c
index b83305c8e7..72c3ea789b 100644
--- a/src/e-util/e-web-view.c
+++ b/src/e-util/e-web-view.c
@@ -916,6 +916,8 @@ web_view_uri_request_done_cb (GObject *source_object,
 
        if (!e_content_request_process_finish (E_CONTENT_REQUEST (source_object),
                result, &stream, &stream_length, &mime_type, &error)) {
+               if (!error)
+                       error = g_error_new (G_IO_ERROR, G_IO_ERROR_FAILED, "Failed to get '%s'", 
webkit_uri_scheme_request_get_uri (request));
                webkit_uri_scheme_request_finish_error (request, error);
                g_clear_error (&error);
        } else {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]