[libdazzle] treenode: handle NULL path in expanded check
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] treenode: handle NULL path in expanded check
- Date: Wed, 29 Nov 2017 07:21:29 +0000 (UTC)
commit b8f9b055726593e1aa9e22eecb880f10c0ddc145
Author: Christian Hergert <chergert redhat com>
Date: Tue Nov 28 23:07:46 2017 -0800
treenode: handle NULL path in expanded check
src/tree/dzl-tree-node.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/tree/dzl-tree-node.c b/src/tree/dzl-tree-node.c
index b5013e6..4968671 100644
--- a/src/tree/dzl-tree-node.c
+++ b/src/tree/dzl-tree-node.c
@@ -661,16 +661,19 @@ dzl_tree_node_invalidate (DzlTreeNode *self)
gboolean
dzl_tree_node_get_expanded (DzlTreeNode *self)
{
- GtkTreePath *path;
gboolean ret = TRUE;
g_return_val_if_fail (DZL_IS_TREE_NODE (self), FALSE);
if ((self->tree != NULL) && (self->parent != NULL))
{
- path = dzl_tree_node_get_path (self);
- ret = gtk_tree_view_row_expanded (GTK_TREE_VIEW (self->tree), path);
- gtk_tree_path_free (path);
+ GtkTreePath *path = dzl_tree_node_get_path (self);
+
+ if (path != NULL)
+ {
+ ret = gtk_tree_view_row_expanded (GTK_TREE_VIEW (self->tree), path);
+ gtk_tree_path_free (path);
+ }
}
return ret;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]