From 141076b18db52e09c95078a816e1b09a2ebcb5a7 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 24 Sep 2021 19:15:22 +0900 Subject: [PATCH] Fix throw by First. Use FirstOrDefault --- Assets/VRM/Runtime/Extensions/glTF_VRMExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/VRM/Runtime/Extensions/glTF_VRMExtensions.cs b/Assets/VRM/Runtime/Extensions/glTF_VRMExtensions.cs index 65d4e7d18..a08f8d01c 100644 --- a/Assets/VRM/Runtime/Extensions/glTF_VRMExtensions.cs +++ b/Assets/VRM/Runtime/Extensions/glTF_VRMExtensions.cs @@ -32,7 +32,7 @@ namespace VRM if (found == null) { var name = binding.RelativePath.Split('/').Last(); - found = root.GetComponentsInChildren().Where(x => x.name == name).First(); + found = root.GetComponentsInChildren().Where(x => x.name == name).FirstOrDefault(); if (found == null) { Debug.LogWarning($"{binding.RelativePath} not found");