Skip to content

Commit

Permalink
fix: improve null checks in CloneControl
Browse files Browse the repository at this point in the history
Fixes: #499
  • Loading branch information
bdunderscore committed Dec 28, 2023
1 parent d87d057 commit 70a6d79
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Editor/Menu/MenuExtractor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#if MA_VRCSDK3_AVATARS

using System;
using System.Linq;
using UnityEditor;
using UnityEngine;
Expand Down Expand Up @@ -119,12 +120,12 @@ internal static VRCExpressionsMenu.Control CloneControl(VRCExpressionsMenu.Contr
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,
};
Expand Down

0 comments on commit 70a6d79

Please sign in to comment.