a11y: return -1 if parent is NULL
authorChristian Hergert <chergert@redhat.com>
Fri, 19 Nov 2021 19:59:29 +0000 (11:59 -0800)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 14 Dec 2021 20:18:13 +0000 (21:18 +0100)
gtk/a11y/gtkatspicontext.c

index b6bd77b69434dfd4f5499e309593cbf5bd5dfcaf..43d40ee257cf7e2d6c7c52403efaf6794d6d60f9 100644 (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;