From 7173ba4e07cb964fd5a8c340dedf20e0b4c61aab Mon Sep 17 00:00:00 2001 From: Gustavo Noronha Silva Date: Fri, 22 Jan 2010 18:15:17 -0200 Subject: Fallback to missing image, when a stock icon could not be found https://bugzilla.gnome.org/show_bug.cgi?id=607804 --- e-util/e-icon-factory.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/e-util/e-icon-factory.c b/e-util/e-icon-factory.c index 411deead24..4f4b8d3a40 100644 --- a/e-util/e-icon-factory.c +++ b/e-util/e-icon-factory.c @@ -100,14 +100,24 @@ e_icon_factory_get_icon (const gchar *icon_name, icon_theme = gtk_icon_theme_get_default (); if (!gtk_icon_size_lookup (icon_size, &width, &height)) - return NULL; + width = height = 16; pixbuf = gtk_icon_theme_load_icon ( icon_theme, icon_name, height, 0, &error); if (error != NULL) { g_warning ("%s", error->message); - g_error_free (error); + g_clear_error (&error); + + /* Fallback to missing image */ + pixbuf = gtk_icon_theme_load_icon ( + icon_theme, GTK_STOCK_MISSING_IMAGE, + height, 0, &error); + + if (error != NULL) { + g_error ("%s", error->message); + g_clear_error (&error); + } } return pixbuf; -- cgit v1.2.3