diff options
author | Руслан Ижбулатов <lrn1986@gmail.com> | 2015-12-24 12:22:50 +0000 |
---|---|---|
committer | Tristan Van Berkom <tristan@upstairslabs.com> | 2015-12-26 16:17:49 +0900 |
commit | 4c46b200e3c214008abc16fb1b87ceb116dabcd4 (patch) | |
tree | 3d26244ae9c11ac908c79b6e7919668c6d89f8e6 /plugins | |
parent | 3a58fe8ae06e5a3de0698b080075b048d8fbef8d (diff) | |
download | glade-4c46b200e3c214008abc16fb1b87ceb116dabcd4.tar.gz |
Don't crash when popover menu children have no visible-submenu set
https://bugzilla.gnome.org/show_bug.cgi?id=759847
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/gtk+/glade-gtk-popover-menu.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) { |