From 2377e48038262b371d750fc0e79664536739a266 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 14 Oct 2008 03:47:18 +0000 Subject: =?UTF-8?q?Bug=20555779=20=E2=80=93=20GtkCellRendererPixbuf=20cras?= =?UTF-8?q?hed=20on=20failed=20GIcon=20lookup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-10-13 Matthias Clasen Bug 555779 – GtkCellRendererPixbuf crashed on failed GIcon lookup * gtk/gtkcellrendererpixbuf (gtk_cell_renderer_pixbuf_create_themed_pixbuf): Don't crash if a GIcon is not present in the current theme. Patch by Alex Larsson. svn path=/trunk/; revision=21650 --- gtk/gtkcellrendererpixbuf.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'gtk/gtkcellrendererpixbuf.c') diff --git a/gtk/gtkcellrendererpixbuf.c b/gtk/gtkcellrendererpixbuf.c index 87a73d673e..a75a88f058 100644 --- a/gtk/gtkcellrendererpixbuf.c +++ b/gtk/gtkcellrendererpixbuf.c @@ -454,8 +454,16 @@ gtk_cell_renderer_pixbuf_create_themed_pixbuf (GtkCellRendererPixbuf *cellpixbuf priv->gicon, MIN (width, height), GTK_ICON_LOOKUP_USE_BUILTIN); - cellpixbuf->pixbuf = gtk_icon_info_load_icon (info, &error); - gtk_icon_info_free (info); + if (!info) + { + g_set_error (&error, GTK_ICON_THEME_ERROR, GTK_ICON_THEME_NOT_FOUND, + _("Icon not present in theme")); + } + else + { + cellpixbuf->pixbuf = gtk_icon_info_load_icon (info, &error); + gtk_icon_info_free (info); + } } if (!cellpixbuf->pixbuf) -- cgit v1.2.1