From dc33780dcf8376114aef79eeaa5259e8fe07ae84 Mon Sep 17 00:00:00 2001 From: joncruz Date: Sun, 19 Apr 2009 01:01:03 +0000 Subject: [PATCH] Handle case when an icon is not populated --- src/ui/widget/dock-item.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ui/widget/dock-item.cpp b/src/ui/widget/dock-item.cpp index 12a0686f0..147bd818d 100644 --- a/src/ui/widget/dock-item.cpp +++ b/src/ui/widget/dock-item.cpp @@ -52,8 +52,15 @@ DockItem::DockItem(Dock& dock, const Glib::ustring& name, const Glib::ustring& l sp_icon_fetch_pixbuf(sp_icon); _icon_pixbuf = Glib::wrap(sp_icon->pb, true); } else if ( GTK_IS_IMAGE(icon->gobj()) ) { - _icon_pixbuf = Gtk::Invisible().render_icon(Gtk::StockID(icon_name), - Gtk::ICON_SIZE_MENU); + GtkStockItem stock; + if ( gtk_stock_lookup( icon_name.c_str(), &stock ) ) { + _icon_pixbuf = Gtk::Invisible().render_icon( Gtk::StockID(icon_name), + Gtk::ICON_SIZE_MENU ); + } else { + // TODO re-work this properly. Anti-crasher "null" icon for the moment + _icon_pixbuf = Gtk::Invisible().render_icon( Gtk::StockID(GTK_STOCK_MISSING_IMAGE), + Gtk::ICON_SIZE_MENU ); + } } delete icon; -- 2.30.2