diff options
author | Xan Lopez <xan@igalia.com> | 2012-03-07 23:30:51 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-03-07 23:30:51 +0800 |
commit | 59d6ec64a71670954023843a751ab427b8469bb5 (patch) | |
tree | f3f24d13975e7e39512d16cb93b1c664cf14a156 | |
parent | 5aa4c1a59201bd7a2304c481cdaf559ea540a316 (diff) | |
download | gsoc2013-epiphany-59d6ec64a71670954023843a751ab427b8469bb5.tar.gz gsoc2013-epiphany-59d6ec64a71670954023843a751ab427b8469bb5.tar.zst gsoc2013-epiphany-59d6ec64a71670954023843a751ab427b8469bb5.zip |
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
-rw-r--r-- | 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 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); } |