# HG changeset patch # User zas_ # Date 1235852682 0 # Node ID 6fb0c1829b7652154dad666ef2f5a749e9db76db # Parent 3f9be528787cb26dcbb6a4d20655857d3319980d Prevent Gtk assertion failures when no icon is set. diff -r 3f9be528787c -r 6fb0c1829b76 src/layout_util.c --- a/src/layout_util.c Sat Feb 28 20:13:11 2009 +0000 +++ b/src/layout_util.c Sat Feb 28 20:24:42 2009 +0000 @@ -1652,7 +1652,7 @@ EditorDescription *editor = work->data; GtkActionEntry entry = { editor->key, NULL, editor->name, editor->hotkey, NULL, G_CALLBACK(layout_menu_edit_cb) }; - if (register_theme_icon_as_stock(editor->key, editor->icon)) + if (editor->icon && register_theme_icon_as_stock(editor->key, editor->icon)) { entry.stock_id = editor->key; } diff -r 3f9be528787c -r 6fb0c1829b76 src/pixbuf_util.c --- a/src/pixbuf_util.c Sat Feb 28 20:13:11 2009 +0000 +++ b/src/pixbuf_util.c Sat Feb 28 20:24:42 2009 +0000 @@ -166,15 +166,18 @@ GError *error = NULL; icon_theme = gtk_icon_theme_get_default(); - pixbuf = gtk_icon_theme_load_icon (icon_theme, + pixbuf = gtk_icon_theme_load_icon(icon_theme, icon, /* icon name */ 64, /* size */ 0, /* flags */ &error); if (!pixbuf) { - DEBUG_1("Couldn't load icon: %s", error->message); - g_error_free(error); + if (error) + { + DEBUG_1("Couldn't load icon: %s", error->message); + g_error_free(error); + } return FALSE; }