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.
This commit is contained in:
Milan Crha 2022-10-13 12:50:56 +02:00
parent 38f245ef0e
commit 5c2210d448

View File

@ -914,6 +914,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 {