]> www.fi.muni.cz Git - evince.git/commitdiff
Fix a crash when a choice form field doesn't have any item selected. Fixes
authorCarlos Garcia Campos <carlosgc@gnome.org>
Wed, 27 Feb 2008 17:32:52 +0000 (17:32 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Wed, 27 Feb 2008 17:32:52 +0000 (17:32 +0000)
2008-02-27  Carlos Garcia Campos  <carlosgc@gnome.org>

* shell/ev-view.c: (ev_view_form_field_choice_changed):

Fix a crash when a choice form field doesn't have any item
selected. Fixes bug #518831

svn path=/trunk/; revision=2930

ChangeLog
shell/ev-view.c

index b1de678df1fef565294784479614d73f67845bde..41c94bb6216d79b303b6bd01a3b18d634dab197a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-02-27  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * shell/ev-view.c: (ev_view_form_field_choice_changed):
+
+       Fix a crash when a choice form field doesn't have any item
+       selected. Fixes bug #518831
+       
 2008-02-25  Alexander Larsson  <alexl@redhat.com>
 
        * shell/ev-window.c (ev_window_clear_temp_file):
index dc1d190f5749b6ba982fcd7c2ac0a6deea3d337f..3b7a60dd30a32eea400bb41bb7ca30d884dd907c 100644 (file)
@@ -1907,7 +1907,8 @@ ev_view_form_field_choice_changed (GtkWidget   *widget,
                gint item;
                
                item = gtk_combo_box_get_active (GTK_COMBO_BOX (widget));
-               if (GPOINTER_TO_INT (field_choice->selected_items->data) != item) {
+               if (!field_choice->selected_items ||
+                   GPOINTER_TO_INT (field_choice->selected_items->data) != item) {
                        g_list_free (field_choice->selected_items);
                        field_choice->selected_items = NULL;
                        field_choice->selected_items = g_list_prepend (field_choice->selected_items,