diff options
author | Milan Crha <mcrha@redhat.com> | 2012-05-11 02:12:02 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2012-05-11 02:12:02 +0800 |
commit | c2380dc855c1b5dda62651045b843c386e0d499d (patch) | |
tree | 44cbbec968d87fb1b1b54f30ac7d6528f3444c01 | |
parent | 250c3cade5534f6ff396f8dbddd999918cba9781 (diff) | |
download | gsoc2013-evolution-c2380dc855c1b5dda62651045b843c386e0d499d.tar gsoc2013-evolution-c2380dc855c1b5dda62651045b843c386e0d499d.tar.gz gsoc2013-evolution-c2380dc855c1b5dda62651045b843c386e0d499d.tar.bz2 gsoc2013-evolution-c2380dc855c1b5dda62651045b843c386e0d499d.tar.lz gsoc2013-evolution-c2380dc855c1b5dda62651045b843c386e0d499d.tar.xz gsoc2013-evolution-c2380dc855c1b5dda62651045b843c386e0d499d.tar.zst gsoc2013-evolution-c2380dc855c1b5dda62651045b843c386e0d499d.zip |
Bug #675728 - Crash in strcmp, e_filter_rule_find_list
-rw-r--r-- | filter/e-rule-editor.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/filter/e-rule-editor.c b/filter/e-rule-editor.c index 4d6bd3e0d3..58ffdc14cd 100644 --- a/filter/e-rule-editor.c +++ b/filter/e-rule-editor.c @@ -208,7 +208,7 @@ update_selected_rule (ERuleEditor *editor) GtkTreeIter iter; selection = gtk_tree_view_get_selection (editor->list); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { + if (selection && gtk_tree_selection_get_selected (selection, &model, &iter)) { gtk_tree_model_get (GTK_TREE_MODEL (editor->model), &iter, 1, &editor->current, -1); return TRUE; } @@ -400,7 +400,11 @@ rule_delete (GtkWidget *widget, pos = e_rule_context_get_rank_rule (editor->context, editor->current, editor->source); if (pos != -1) { - e_rule_context_remove_rule (editor->context, editor->current); + EFilterRule *delete_rule = editor->current; + + editor->current = NULL; + + e_rule_context_remove_rule (editor->context, delete_rule); path = gtk_tree_path_new (); gtk_tree_path_append_index (path, pos); @@ -408,12 +412,11 @@ rule_delete (GtkWidget *widget, gtk_list_store_remove (editor->model, &iter); gtk_tree_path_free (path); - rule_editor_add_undo (editor, E_RULE_EDITOR_LOG_REMOVE, editor->current, - e_rule_context_get_rank_rule (editor->context, editor->current, editor->current->source), 0); + rule_editor_add_undo (editor, E_RULE_EDITOR_LOG_REMOVE, delete_rule, + e_rule_context_get_rank_rule (editor->context, delete_rule, delete_rule->source), 0); #if 0 - g_object_unref (editor->current); + g_object_unref (delete_rule); #endif - editor->current = NULL; /* now select the next rule */ len = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (editor->model), NULL); |