fix: improve null checks in CloneControl (#597)

Fixes: #499
This commit is contained in:
bd_ 2023-12-28 17:58:47 +09:00 committed by GitHub
parent 29e0671cfe
commit 6689c15ce9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,6 @@
#if MA_VRCSDK3_AVATARS
using System;
using System.Linq;
using UnityEditor;
using UnityEngine;
@ -119,12 +120,12 @@ namespace nadena.dev.modular_avatar.core.editor
type = c.type,
name = c.name,
icon = c.icon,
parameter = new VRCExpressionsMenu.Control.Parameter() {name = c.parameter?.name},
parameter = new VRCExpressionsMenu.Control.Parameter() { name = c.parameter?.name },
subMenu = c.subMenu,
subParameters = c.subParameters?.Select(p =>
new VRCExpressionsMenu.Control.Parameter() {name = p?.name})
.ToArray(),
labels = c.labels.ToArray(),
new VRCExpressionsMenu.Control.Parameter() { name = p?.name })
?.ToArray() ?? Array.Empty<VRCExpressionsMenu.Control.Parameter>(),
labels = c.labels?.ToArray() ?? Array.Empty<VRCExpressionsMenu.Control.Label>(),
style = c.style,
value = c.value,
};