[gtk+] flowbox: Be careful when the container is empty



commit 65dd26d3f35b0fa32f461eaee9eace53520f1f03
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Oct 21 16:21:11 2013 +0200

    flowbox: Be careful when the container is empty
    
    Otherwise, showing an empty GtkFlowBox will lead to:
    GLib-CRITICAL **: g_sequence_get: assertion '!is_end (iter)' failed

 gtk/gtkflowbox.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c
index e9c6367..0bac89b 100644
--- a/gtk/gtkflowbox.c
+++ b/gtk/gtkflowbox.c
@@ -1215,6 +1215,9 @@ gtk_flow_box_get_first_focusable (GtkFlowBox *box)
   GtkFlowBoxChild *child;
 
   iter = g_sequence_get_begin_iter (BOX_PRIV (box)->children);
+  if (g_sequence_iter_is_end (iter))
+    return NULL;
+
   child = g_sequence_get (iter);
   if (child_is_visible (GTK_WIDGET (child)) &&
       gtk_widget_is_sensitive (GTK_WIDGET (child)))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]