From 7d61aad12cdc1bf035a62716fbdb9997c60eae90 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Thu, 29 Mar 2018 08:32:51 +0200 Subject: [PATCH] menubar: Don't crash when cycling through menubars --- gtk/gtkmenubar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c index 170c2722dc..27e444057e 100644 --- a/gtk/gtkmenubar.c +++ b/gtk/gtkmenubar.c @@ -584,7 +584,7 @@ _gtk_menu_bar_cycle_focus (GtkMenuBar *menubar, found = g_ptr_array_find (menubars, menubar, &index); - if (found && index < menubars->len) + if (found && index < menubars->len - 1) { GtkWidget *next = g_ptr_array_index (menubars, index + 1); GtkMenuShell *new_menushell = GTK_MENU_SHELL (next); -- 2.30.2