diff options
author | Matthias Clasen <mclasen@redhat.com> | 2004-11-03 06:16:43 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-11-03 06:16:43 +0000 |
commit | f41c59cce3be046727b23b71b7afcfece889aeab (patch) | |
tree | d2a9e8f3283682d726a405dfc9b104b626c2b5c4 /gtk/gtkcombobox.c | |
parent | a781654839cfc4c5e1fffa54716d234dd8ddccc9 (diff) | |
download | gtk+-f41c59cce3be046727b23b71b7afcfece889aeab.tar.gz |
Don't crash if the active_row reference has become invalid. (#157156,
2004-11-03 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcombobox.c (gtk_combo_box_get_active): Don't crash
if the active_row reference has become invalid. (#157156,
Christophe Fergeau)
Diffstat (limited to 'gtk/gtkcombobox.c')
-rw-r--r-- | gtk/gtkcombobox.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index aabb3b3c1e..2b88dc09ea 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -4212,8 +4212,13 @@ gtk_combo_box_get_active (GtkComboBox *combo_box) { GtkTreePath *path; path = gtk_tree_row_reference_get_path (combo_box->priv->active_row); - result = gtk_tree_path_get_indices (path)[0]; - gtk_tree_path_free (path); + if (path == NULL) + result = -1; + else + { + result = gtk_tree_path_get_indices (path)[0]; + gtk_tree_path_free (path); + } } else result = -1; |