From 137b25cf53f1a0761065eaff0ae2482458740369 Mon Sep 17 00:00:00 2001 From: jsjtxietian Date: Tue, 31 Oct 2023 11:39:43 +0800 Subject: [PATCH] Fix `activate_item_by_event` infinite recursion crash --- scene/gui/popup_menu.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index ec9e2cacb4a8..0cda27ec24c6 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -1487,6 +1487,7 @@ void PopupMenu::add_icon_radio_check_shortcut(const Ref &p_icon, cons } void PopupMenu::add_submenu_item(const String &p_label, const String &p_submenu, int p_id) { + ERR_FAIL_COND_MSG(p_submenu.validate_node_name() != p_submenu, "Invalid node name for submenu, the following characters are not allowed:\n" + String::get_invalid_node_name_characters()); Item item; item.text = p_label; item.xl_text = atr(p_label);