Protect against tree_view being NULL

This apparently happens when setting the "visible" property
from ui files.
https://bugzilla.gnome.org/show_bug.cgi?id=640801
This commit is contained in:
Matthias Clasen 2011-02-02 23:54:38 -05:00
parent b51f3ffffc
commit 99691ab7aa

View File

@ -1891,7 +1891,7 @@ gtk_tree_view_column_get_spacing (GtkTreeViewColumn *tree_column)
* @visible: %TRUE if the @tree_column is visible.
*
* Sets the visibility of @tree_column.
**/
*/
void
gtk_tree_view_column_set_visible (GtkTreeViewColumn *tree_column,
gboolean visible)
@ -1911,6 +1911,7 @@ gtk_tree_view_column_set_visible (GtkTreeViewColumn *tree_column,
if (priv->visible)
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
if (priv->tree_view)
_gtk_tree_view_reset_header_styles (GTK_TREE_VIEW (priv->tree_view));
gtk_tree_view_column_update_button (tree_column);