--- gailitem.c.orig	2006-11-17 13:23:44.000000000 +0000
+++ gailitem.c	2007-01-19 11:36:18.397897000 +0000
@@ -287,6 +287,8 @@
               list = gtk_container_get_children (GTK_CONTAINER (parent));
               index = g_list_index (list, widget);
               g_list_free (list);
+              if (index == -1)
+                return NULL;
               parent_obj = atk_object_get_parent (gtk_widget_get_accessible (parent));
               if (GTK_IS_ACCESSIBLE (parent_obj))
                 {
