Fixes #2750. MenuBar (without children) causes stack overflow when shortcut is pressed.

This commit is contained in:
BDisp
2023-07-19 12:33:10 +01:00
committed by Tig
parent 7888365743
commit 7aad349317

View File

@@ -1842,7 +1842,7 @@ namespace Terminal.Gui {
}
return true;
}
if (mi is MenuBarItem menuBarItem && !menuBarItem.IsTopLevel && FindAndOpenMenuByShortcut (kb, menuBarItem.Children)) {
if (mi is MenuBarItem menuBarItem && menuBarItem.Children != null && !menuBarItem.IsTopLevel && FindAndOpenMenuByShortcut (kb, menuBarItem.Children)) {
return true;
}
}