From 435ce7b24801e610ef6f268d20582605b9354471 Mon Sep 17 00:00:00 2001 From: bd_ Date: Mon, 2 Jan 2023 16:41:27 +0900 Subject: [PATCH] fix: NPE in menu installer editor --- .../Editor/Inspector/MenuInstallerEditor.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Packages/nadena.dev.modular-avatar/Editor/Inspector/MenuInstallerEditor.cs b/Packages/nadena.dev.modular-avatar/Editor/Inspector/MenuInstallerEditor.cs index f7ca7bcc..13310e65 100644 --- a/Packages/nadena.dev.modular-avatar/Editor/Inspector/MenuInstallerEditor.cs +++ b/Packages/nadena.dev.modular-avatar/Editor/Inspector/MenuInstallerEditor.cs @@ -282,9 +282,13 @@ namespace nadena.dev.modular_avatar.core.editor if (result != ValidateExpressionMenuIconResult.Success) return result; // Labels - foreach (VRCExpressionsMenu.Control.Label label in control.labels) { - ValidateExpressionMenuIconResult labelResult = Util.ValidateExpressionMenuIcon(label.icon); - if (labelResult != ValidateExpressionMenuIconResult.Success) return labelResult; + if (control.labels != null) + { + foreach (VRCExpressionsMenu.Control.Label label in control.labels) + { + ValidateExpressionMenuIconResult labelResult = Util.ValidateExpressionMenuIcon(label.icon); + if (labelResult != ValidateExpressionMenuIconResult.Success) return labelResult; + } } // SubMenu