From fb15adfad07e0f3c6f66737f66fa22be596af36e Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Tue, 27 Jul 2021 11:59:54 +0800 Subject: [PATCH] Fix crash when executing PopupMenu.new()._submenu_timeout() --- scene/gui/popup_menu.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index bb554a0648e..5b5a8a48935 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -179,6 +179,8 @@ void PopupMenu::_activate_submenu(int over) { } void PopupMenu::_submenu_timeout() { + ERR_FAIL_COND(submenu_over == -1); + if (mouse_over == submenu_over) { _activate_submenu(mouse_over); }