[gtk+/gtk-3-12] listbox: check gsequence end iter in get_row_at_index
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-12] listbox: check gsequence end iter in get_row_at_index
- Date: Sun, 4 May 2014 18:00:05 +0000 (UTC)
commit 7ff1142ee919f2f3c6a5226abede823ee7a2980a
Author: Paolo Borelli <pborelli gnome org>
Date: Sun May 4 19:38:31 2014 +0200
listbox: check gsequence end iter in get_row_at_index
gtk/gtklistbox.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index c4bc26c..ea612c3 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -496,8 +496,10 @@ gtk_list_box_get_selected_row (GtkListBox *list_box)
* @index_: the index of the row
*
* Gets the n:th child in the list (not counting headers).
+ * If @_index is negative or larger than the number of items in the
+ * list, %NULL is returned.
*
- * Returns: (transfer none): the child #GtkWidget
+ * Returns: (transfer none): the child #GtkWidget or %NULL
*
* Since: 3.10
*/
@@ -513,7 +515,7 @@ gtk_list_box_get_row_at_index (GtkListBox *list_box,
priv = gtk_list_box_get_instance_private (list_box);
iter = g_sequence_get_iter_at_pos (priv->children, index_);
- if (iter)
+ if (!g_sequence_iter_is_end (iter))
return g_sequence_get (iter);
return NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]