diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-05-18 00:55:44 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-05-18 00:55:44 +0000 |
commit | cad582a4059c59a0dcd86998975ea754e74211ba (patch) | |
tree | a1d00a6c15bddc280bb0e6a0d37e86ed42aa74a4 /gtk/main.c | |
parent | 399e5715473b13670e6706026d49024a4372e8f1 (diff) |
fix #187: don't crash if using "Expand Subtrees" in an empty area, just do nothing in that case
svn path=/trunk/; revision=14389
Diffstat (limited to 'gtk/main.c')
-rw-r--r-- | gtk/main.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gtk/main.c b/gtk/main.c index 59daacbe23..25bb5e524b 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -770,13 +770,17 @@ void expand_tree_cb(GtkWidget *widget _U_, gpointer data _U_) { #if GTK_MAJOR_VERSION < 2 node = gtk_ctree_find_by_row_data(GTK_CTREE(tree_view), NULL, cfile.finfo_selected); - g_assert(node); - gtk_ctree_expand_recursive(GTK_CTREE(tree_view), node); + if(node) { + /* the mouse position is at an entry, expand that one */ + gtk_ctree_expand_recursive(GTK_CTREE(tree_view), node); + } #else path = tree_find_by_field_info(GTK_TREE_VIEW(tree_view), cfile.finfo_selected); - g_assert(path); - gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE); - gtk_tree_path_free(path); + if(path) { + /* the mouse position is at an entry, expand that one */ + gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE); + gtk_tree_path_free(path); + } #endif } |