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 #if MA_VRCSDK3_AVATARS
using System;
using System.Linq; using System.Linq;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;
@ -123,8 +124,8 @@ namespace nadena.dev.modular_avatar.core.editor
subMenu = c.subMenu, subMenu = c.subMenu,
subParameters = c.subParameters?.Select(p => subParameters = c.subParameters?.Select(p =>
new VRCExpressionsMenu.Control.Parameter() { name = p?.name }) new VRCExpressionsMenu.Control.Parameter() { name = p?.name })
.ToArray(), ?.ToArray() ?? Array.Empty<VRCExpressionsMenu.Control.Parameter>(),
labels = c.labels.ToArray(), labels = c.labels?.ToArray() ?? Array.Empty<VRCExpressionsMenu.Control.Label>(),
style = c.style, style = c.style,
value = c.value, value = c.value,
}; };