[evolution] EHTMLEditorSpellCheckDialog - Avoid crash when no iter was set in the dictionaries combo box



commit ffb24a97f700e24a944e5df1bf2b0369a6c73ab5
Author: Tomas Popela <tpopela redhat com>
Date:   Tue Jul 29 15:10:19 2014 +0200

    EHTMLEditorSpellCheckDialog - Avoid crash when no iter was set in the dictionaries combo box

 e-util/e-html-editor-spell-check-dialog.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/e-util/e-html-editor-spell-check-dialog.c b/e-util/e-html-editor-spell-check-dialog.c
index d391860..5d632a1 100644
--- a/e-util/e-html-editor-spell-check-dialog.c
+++ b/e-util/e-html-editor-spell-check-dialog.c
@@ -400,15 +400,16 @@ html_editor_spell_check_dialog_set_dictionary (EHTMLEditorSpellCheckDialog *dial
        ESpellDictionary *dictionary;
 
        combo_box = GTK_COMBO_BOX (dialog->priv->dictionary_combo);
-       gtk_combo_box_get_active_iter (combo_box, &iter);
-       model = gtk_combo_box_get_model (combo_box);
+       if (gtk_combo_box_get_active_iter (combo_box, &iter)) {
+               model = gtk_combo_box_get_model (combo_box);
 
-       gtk_tree_model_get (model, &iter, 1, &dictionary, -1);
+               gtk_tree_model_get (model, &iter, 1, &dictionary, -1);
 
-       dialog->priv->current_dict = dictionary;
+               dialog->priv->current_dict = dictionary;
 
-       /* Update suggestions */
-       html_editor_spell_check_dialog_set_word (dialog, dialog->priv->word);
+               /* Update suggestions */
+               html_editor_spell_check_dialog_set_word (dialog, dialog->priv->word);
+       }
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]