[epiphany] ephy-web-view: protect against pages with NULL URI



commit 59d6ec64a71670954023843a751ab427b8469bb5
Author: Xan Lopez <xan igalia com>
Date:   Wed Mar 7 16:30:51 2012 +0100

    ephy-web-view: protect against pages with NULL URI
    
    Some pages (like those opened with javascript:...) can have a NULL URI
    according to WebKit, so protect against that.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=671555

 embed/ephy-web-view.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index eb8dbc3..6448b0e 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1074,14 +1074,16 @@ title_changed_cb (WebKitWebView *web_view,
   g_object_get (web_view, "title", &title, NULL);
 
   /* Fallback to the URI as title if it's NULL. */
-  if (title == NULL || g_str_equal (title, "")) {
+  if ((title == NULL || g_str_equal (title, "")) && uri != NULL) {
     g_free (title);
     title = g_strdup (uri);
   }
 
-  ephy_web_view_set_title (EPHY_WEB_VIEW (web_view),
-                           title);
-  ephy_history_service_set_url_title (history, uri, title, NULL, NULL);
+  ephy_web_view_set_title (EPHY_WEB_VIEW (web_view), title);
+
+  if (uri && title)
+    ephy_history_service_set_url_title (history, uri, title, NULL, NULL);
+
   g_free (title);
 
 }



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