[Xfce4-commits] <midori:master> Handle NULL datasource in webkit_web_view_download_requested_cb

Christian Dywan noreply at xfce.org
Sun May 13 02:24:04 CEST 2012


Updating branch refs/heads/master
         to 23d51753fddd727eadefc0e18989b79f7254bc34 (commit)
       from 89bae74a323b0e83d9a24fd2c3806deba645651c (commit)

commit 23d51753fddd727eadefc0e18989b79f7254bc34
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sun May 13 02:15:02 2012 +0200

    Handle NULL datasource in webkit_web_view_download_requested_cb

 midori/midori-view.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/midori/midori-view.c b/midori/midori-view.c
index 1ca8011..8057316 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -2959,9 +2959,16 @@ webkit_web_view_download_requested_cb (GtkWidget*      web_view,
     /* We look at the original URI because redirection would lose the fragment */
     web_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (web_view));
     datasource = webkit_web_frame_get_provisional_data_source (web_frame);
-    original_request = webkit_web_data_source_get_initial_request (datasource);
-    original_uri = webkit_network_request_get_uri (original_request);
-    midori_uri_get_fingerprint (original_uri, &fingerprint, &fplabel);
+    if (datasource)
+    {
+        original_request = webkit_web_data_source_get_initial_request (datasource);
+        original_uri = webkit_network_request_get_uri (original_request);
+        midori_uri_get_fingerprint (original_uri, &fingerprint, &fplabel);
+    }
+    else
+    {
+        fingerprint = fplabel = NULL;
+    }
     gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
         "%s\n%s\n%s %s", file_name, file_type, fplabel ? fplabel : "", fingerprint ? fingerprint : "");
     g_free (fingerprint);


More information about the Xfce4-commits mailing list