flowbox: Fix get_child_at_index crash with an invalid index

https://bugzilla.gnome.org/show_bug.cgi?id=775525
This commit is contained in:
Debarshi Ray
2016-12-02 16:38:05 +01:00
parent e6d7df7233
commit 8952975304

View File

@ -4321,7 +4321,7 @@ gtk_flow_box_get_child_at_index (GtkFlowBox *box,
g_return_val_if_fail (GTK_IS_FLOW_BOX (box), NULL);
iter = g_sequence_get_iter_at_pos (BOX_PRIV (box)->children, idx);
if (iter)
if (!g_sequence_iter_is_end (iter))
return g_sequence_get (iter);
return NULL;