Merge pull request #50924 from timothyqiu/popup-menu-check

[3.x] Fix crash when executing PopupMenu.new()._submenu_timeout()
This commit is contained in:
Rémi Verschelde 2021-07-27 10:00:50 +02:00 committed by GitHub
commit 5e279516bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -179,6 +179,8 @@ void PopupMenu::_activate_submenu(int over) {
} }
void PopupMenu::_submenu_timeout() { void PopupMenu::_submenu_timeout() {
ERR_FAIL_COND(submenu_over == -1);
if (mouse_over == submenu_over) { if (mouse_over == submenu_over) {
_activate_submenu(mouse_over); _activate_submenu(mouse_over);
} }