diff options
author | Matthias Clasen <mclasen@redhat.com> | 2008-10-14 03:47:18 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2008-10-14 03:47:18 +0000 |
commit | 2377e48038262b371d750fc0e79664536739a266 (patch) | |
tree | 9a10a677fec1ea4f53b2a89eebdcca08e28afaab /gtk/gtkcellrendererpixbuf.c | |
parent | 784896ae1e98ebc38bb0f206767700fecf1c4abb (diff) | |
download | gtk+-2377e48038262b371d750fc0e79664536739a266.tar.gz |
Bug 555779 – GtkCellRendererPixbuf crashed on failed GIcon lookup
2008-10-13 Matthias Clasen <mclasen@redhat.com>
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
Diffstat (limited to 'gtk/gtkcellrendererpixbuf.c')
-rw-r--r-- | gtk/gtkcellrendererpixbuf.c | 12 |
1 files changed, 10 insertions, 2 deletions
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) |