From 4c46b200e3c214008abc16fb1b87ceb116dabcd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Thu, 24 Dec 2015 12:22:50 +0000 Subject: Don't crash when popover menu children have no visible-submenu set https://bugzilla.gnome.org/show_bug.cgi?id=759847 --- plugins/gtk+/glade-gtk-popover-menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/gtk+/glade-gtk-popover-menu.c b/plugins/gtk+/glade-gtk-popover-menu.c index d74d25c6..773d05e1 100644 --- a/plugins/gtk+/glade-gtk-popover-menu.c +++ b/plugins/gtk+/glade-gtk-popover-menu.c @@ -126,14 +126,14 @@ get_visible_child (GtkPopoverMenu *popover, GtkWidget **visible_child) g_object_get (G_OBJECT (popover), "visible-submenu", &visible, NULL); children = gtk_container_get_children (GTK_CONTAINER (popover)); - for (l = children, i = 0; l; l = l->next, i++) + for (l = children, i = 0; visible && l; l = l->next, i++) { GtkWidget *child = l->data; gchar *name; gboolean found; gtk_container_child_get (GTK_CONTAINER (popover), child, "submenu", &name, NULL); - found = !strcmp (visible, name); + found = name != NULL && !strcmp (visible, name); g_free (name); if (found) { -- cgit v1.2.1