]> spindle.queued.net Git - midori/commitdiff
Check download-mime-type which may not be set
authorChristian Dywan <christian@twotoasts.de>
Sun, 20 May 2012 19:59:35 +0000 (21:59 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sun, 20 May 2012 20:03:38 +0000 (22:03 +0200)
Not all downloads go through MIME type policy.

midori/midori-view.c

index eec4588a2357aaae0db19ceb7ea414e734ec9bcf..757707c0785d746369d97111e515e0c5bc7632a9 100644 (file)
@@ -2941,8 +2941,11 @@ webkit_web_view_download_requested_cb (GtkWidget*      web_view,
     dialog = gtk_message_dialog_new (
         NULL, 0, GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE,
         _("Open or download file"));
-    mime_type = g_object_get_data(G_OBJECT (view), "download-mime-type");
-    content_type = g_content_type_from_mime_type (mime_type);
+    mime_type = g_object_get_data (G_OBJECT (view), "download-mime-type");
+    if (mime_type != NULL)
+        content_type = g_content_type_from_mime_type (mime_type);
+    else
+        content_type = NULL;
     if (!content_type)
         content_type = g_content_type_guess (
             webkit_download_get_suggested_filename (download), NULL, 0, NULL);