From 642196dbcf1468d7afb4fd3db6f7c7e78d53a670 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pekka=20Geh=C3=B6r?= Date: Wed, 21 Jan 2009 14:00:09 +0200 Subject: [PATCH] Added button and bg check. When delete --- irreco/src/core/irreco_theme_creator_dlg.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/irreco/src/core/irreco_theme_creator_dlg.c b/irreco/src/core/irreco_theme_creator_dlg.c index 9315b369..a18c1345 100644 --- a/irreco/src/core/irreco_theme_creator_dlg.c +++ b/irreco/src/core/irreco_theme_creator_dlg.c @@ -862,19 +862,24 @@ static void irreco_theme_creator_dlg_delete_bg_button(GtkButton *button, IrrecoThemeBg *bg; bg = irreco_theme_creator_backgrounds_get_selected_bg( IRRECO_THEME_CREATOR_BACKGROUNDS(self->backgrounds)); - if (irreco_theme_creator_backgrounds_remove_selected( - IRRECO_THEME_CREATOR_BACKGROUNDS(self->backgrounds))) { - irreco_string_table_remove((self->theme)->backgrounds, - bg->image_name->str); + + if (bg !=NULL) { + if (irreco_theme_creator_backgrounds_remove_selected( + IRRECO_THEME_CREATOR_BACKGROUNDS(self->backgrounds))) { + irreco_string_table_remove((self->theme)->backgrounds, + bg->image_name->str); + } } } else { IrrecoThemeButton *button; button = irreco_theme_creator_buttons_get_selected_button( IRRECO_THEME_CREATOR_BUTTONS(self->buttons)); - if (irreco_theme_creator_buttons_remove_selected( - IRRECO_THEME_CREATOR_BUTTONS(self->buttons))) { - irreco_string_table_remove((self->theme)->buttons, - button->style_name->str); + if (button !=NULL) { + if (irreco_theme_creator_buttons_remove_selected( + IRRECO_THEME_CREATOR_BUTTONS(self->buttons))) { + irreco_string_table_remove((self->theme)->buttons, + button->style_name->str); + } } self->preview_name = NULL; g_string_printf(self->theme->preview_button_name, "%s", ""); -- 2.11.4.GIT