summaryrefslogtreecommitdiff
path: root/gtk/gtkcombobox.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-11-03 06:16:43 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-11-03 06:16:43 +0000
commitf41c59cce3be046727b23b71b7afcfece889aeab (patch)
treed2a9e8f3283682d726a405dfc9b104b626c2b5c4 /gtk/gtkcombobox.c
parenta781654839cfc4c5e1fffa54716d234dd8ddccc9 (diff)
downloadgtk+-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.c9
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;