Merge pull request #90791 from timothyqiu/see-you-again

Fix potential infinite loop when using global menu
This commit is contained in:
Rémi Verschelde 2024-04-17 20:26:34 +02:00
commit acd3d2497f
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 1 additions and 1 deletions

View File

@ -212,7 +212,7 @@ String DisplayServer::global_menu_get_item_submenu(const String &p_menu_root, in
ERR_FAIL_NULL_V(nmenu, String()); ERR_FAIL_NULL_V(nmenu, String());
RID rid = nmenu->get_item_submenu(_get_rid_from_name(nmenu, p_menu_root), p_idx); RID rid = nmenu->get_item_submenu(_get_rid_from_name(nmenu, p_menu_root), p_idx);
if (!nmenu->is_system_menu(rid)) { if (!nmenu->is_system_menu(rid)) {
for (HashMap<String, RID>::Iterator E = menu_names.begin(); E;) { for (HashMap<String, RID>::Iterator E = menu_names.begin(); E; ++E) {
if (E->value == rid) { if (E->value == rid) {
return E->key; return E->key;
} }