fix: NRE from Menu Item UI when expression parameters is missing (#1022)

Closes: #797
This commit is contained in:
bd_ 2024-08-19 18:43:57 -07:00 committed by GitHub
parent c7df409d70
commit 159865e6cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -275,10 +275,11 @@ namespace nadena.dev.modular_avatar.core.editor
}
var desc = node?.GetComponent<VRCAvatarDescriptor>();
if (desc != null)
if (desc?.expressionParameters?.parameters != null)
{
foreach (var param in desc.expressionParameters.parameters)
{
if (param == null) continue;
if (emitted.Add(param.name)) yield return (node, param.name);
}
}