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
This commit is contained in:
Debarshi Ray 2013-10-21 16:21:11 +02:00
parent 3971ed1779
commit 65dd26d3f3

View File

@ -1215,6 +1215,9 @@ gtk_flow_box_get_first_focusable (GtkFlowBox *box)
GtkFlowBoxChild *child; GtkFlowBoxChild *child;
iter = g_sequence_get_begin_iter (BOX_PRIV (box)->children); iter = g_sequence_get_begin_iter (BOX_PRIV (box)->children);
if (g_sequence_iter_is_end (iter))
return NULL;
child = g_sequence_get (iter); child = g_sequence_get (iter);
if (child_is_visible (GTK_WIDGET (child)) && if (child_is_visible (GTK_WIDGET (child)) &&
gtk_widget_is_sensitive (GTK_WIDGET (child))) gtk_widget_is_sensitive (GTK_WIDGET (child)))