fix: self-referencing menus result in stack overflow (#827)

Closes: #826, #810
This commit is contained in:
bd_ 2024-04-16 14:33:17 +09:00 committed by GitHub
parent a88385a0da
commit 84ab43b2af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -141,7 +141,7 @@ namespace nadena.dev.modular_avatar.core.editor
foreach (var control in newMenu.controls)
{
if (control.type == VRCExpressionsMenu.Control.ControlType.SubMenu)
if (control.type == VRCExpressionsMenu.Control.ControlType.SubMenu && control.subMenu != newMenu)
{
control.subMenu = CloneMenu(control.subMenu);
}