From 05eab03df512dc093183e36dd408a5ab173ec4b8 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Date: Fri, 14 Dec 2012 19:55:45 +0100 Subject: ephy-removable-pixbuf-renderer: don't crash if no close icon is found https://bugzilla.gnome.org/show_bug.cgi?id=690216 --- lib/widgets/ephy-removable-pixbuf-renderer.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/widgets/ephy-removable-pixbuf-renderer.c b/lib/widgets/ephy-removable-pixbuf-renderer.c index c0199ebb7..b88b900c6 100644 --- a/lib/widgets/ephy-removable-pixbuf-renderer.c +++ b/lib/widgets/ephy-removable-pixbuf-renderer.c @@ -219,6 +219,7 @@ static void ephy_removable_pixbuf_renderer_init (EphyRemovablePixbufRenderer *self) { GtkIconTheme *icon_theme; + GError *error = NULL; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EPHY_TYPE_REMOVABLE_PIXBUF_RENDERER, EphyRemovablePixbufRendererPrivate); @@ -226,7 +227,14 @@ ephy_removable_pixbuf_renderer_init (EphyRemovablePixbufRenderer *self) icon_theme = gtk_icon_theme_get_default (); self->priv->close_icon = gtk_icon_theme_load_icon (icon_theme, "window-close-symbolic", - 24, 0, NULL); + 24, 0, &error); + + if (error != NULL) { + self->priv->close_icon = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, 24, 24); + gdk_pixbuf_fill (self->priv->close_icon, 0); + g_warning ("%s(): %s", G_STRFUNC, error->message); + g_error_free (error); + } } GtkCellRenderer * -- cgit v1.2.3