aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-web-view.c
diff options
context:
space:
mode:
authorMario Sanchez Prada <mario@mariospr.org>2012-12-11 00:38:13 +0800
committerMario Sanchez Prada <mario@mariospr.org>2012-12-11 01:21:09 +0800
commit90274a4fca5c6907f0903a991871f5fd38a621ee (patch)
tree2ea0f69fcdaaec759991aa54233066af187da017 /embed/ephy-web-view.c
parent533c34899f09a1fa0e80aa198bd72ec2a90b1689 (diff)
downloadgsoc2013-epiphany-90274a4fca5c6907f0903a991871f5fd38a621ee.tar
gsoc2013-epiphany-90274a4fca5c6907f0903a991871f5fd38a621ee.tar.gz
gsoc2013-epiphany-90274a4fca5c6907f0903a991871f5fd38a621ee.tar.bz2
gsoc2013-epiphany-90274a4fca5c6907f0903a991871f5fd38a621ee.tar.lz
gsoc2013-epiphany-90274a4fca5c6907f0903a991871f5fd38a621ee.tar.xz
gsoc2013-epiphany-90274a4fca5c6907f0903a991871f5fd38a621ee.tar.zst
gsoc2013-epiphany-90274a4fca5c6907f0903a991871f5fd38a621ee.zip
Add missing NULL-check when getting the WebView's URI
We need to check the URI is valid before asking the WebKitFaviconDatabase for the associated icon, since it must happen that it's NULL even if priv->address is not (e.g. after a load error has occurred).
Diffstat (limited to 'embed/ephy-web-view.c')
-rw-r--r--embed/ephy-web-view.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 09d23a4ac..2acc8b513 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1099,9 +1099,10 @@ _ephy_web_view_update_icon (EphyWebView *view)
if (icon_surface)
priv->icon = ephy_pixbuf_get_from_surface_scaled (icon_surface, FAVICON_SIZE, FAVICON_SIZE);
#else
- priv->icon = webkit_favicon_database_try_get_favicon_pixbuf (webkit_get_favicon_database (),
- webkit_web_view_get_uri (WEBKIT_WEB_VIEW (view)),
- FAVICON_SIZE, FAVICON_SIZE);
+ const char *page_uri = webkit_web_view_get_uri (WEBKIT_WEB_VIEW (view));
+ if (page_uri)
+ priv->icon = webkit_favicon_database_try_get_favicon_pixbuf (webkit_get_favicon_database (), page_uri,
+ FAVICON_SIZE, FAVICON_SIZE);
#endif
}