a11y: return -1 if parent is NULL

This commit is contained in:
Christian Hergert 2021-11-19 11:59:29 -08:00 committed by Samuel Thibault
parent 075e954b71
commit 2fa9f934b6

View File

@ -334,6 +334,9 @@ get_index_in_parent (GtkWidget *widget)
GtkWidget *child;
int idx;
if (parent == NULL)
return -1;
idx = 0;
for (child = gtk_widget_get_first_child (parent);
child;