From 59d6ec64a71670954023843a751ab427b8469bb5 Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Wed, 7 Mar 2012 16:30:51 +0100 Subject: 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 file changed, 6 insertions(+), 4 deletions(-) diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index eb8dbc361..6448b0e2d 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); } -- cgit