Skip to content

Commit

Permalink
test-inspect: handle special case iter==NULL
Browse files Browse the repository at this point in the history
GtkTreeView has this special case that iter==NULL means the
root node.

Reported-by: Dibyendu Majumdar <[email protected]>
Signed-off-by: Christopher Li <[email protected]>
  • Loading branch information
sparsecli committed Aug 11, 2017
1 parent 817082c commit 38f3ca6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ast-model.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,8 @@ static gint
ast_iter_n_children (GtkTreeModel *tree_model,
GtkTreeIter *iter)
{
AstNode *node = iter->user_data;
AstNode *node = iter ? iter->user_data
: AST_NODE(tree_model);

inspect_child_node(node);
return node->childnodes->len;
Expand Down

0 comments on commit 38f3ca6

Please sign in to comment.