From d692cab641aa76330247a2991ee8e510fc1bf75d Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 7 Jul 2000 03:00:52 +0000 Subject: add a g_return_val_if_fail to etree_node_at_row svn path=/trunk/; revision=3937 --- widgets/e-table/e-tree-model.c | 4 ++-- widgets/table/e-tree-model.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'widgets') diff --git a/widgets/e-table/e-tree-model.c b/widgets/e-table/e-tree-model.c index 40e54a1667..e8685a8dc8 100644 --- a/widgets/e-table/e-tree-model.c +++ b/widgets/e-table/e-tree-model.c @@ -199,9 +199,9 @@ etree_set_expanded_recurse (ETreeModel *etm, ETreePath* node, gboolean expanded) static ETreePath * etree_node_at_row (ETreeModel *etree, int row) { - GNode *node = g_array_index (etree->row_array, GNode*, row); + g_return_val_if_fail (row < etree->row_array->len, NULL); - return node; + return g_array_index (etree->row_array, GNode*, row); } diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c index 40e54a1667..e8685a8dc8 100644 --- a/widgets/table/e-tree-model.c +++ b/widgets/table/e-tree-model.c @@ -199,9 +199,9 @@ etree_set_expanded_recurse (ETreeModel *etm, ETreePath* node, gboolean expanded) static ETreePath * etree_node_at_row (ETreeModel *etree, int row) { - GNode *node = g_array_index (etree->row_array, GNode*, row); + g_return_val_if_fail (row < etree->row_array->len, NULL); - return node; + return g_array_index (etree->row_array, GNode*, row); } -- cgit