From f40d02ceb95a4583adb7d33fd3b7d8785dbded29 Mon Sep 17 00:00:00 2001 From: bd_ Date: Sat, 12 Oct 2024 17:29:27 -0700 Subject: [PATCH] fix: NRE when `AnimatorControllerLayer.stateMachine` is null (#1283) Closes: #1056 --- Editor/Animation/AnimatorCombiner.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Editor/Animation/AnimatorCombiner.cs b/Editor/Animation/AnimatorCombiner.cs index 674140dc..6a64fe28 100644 --- a/Editor/Animation/AnimatorCombiner.cs +++ b/Editor/Animation/AnimatorCombiner.cs @@ -573,6 +573,8 @@ namespace nadena.dev.modular_avatar.animation private AnimatorStateMachine mapStateMachine(string basePath, AnimatorStateMachine layerStateMachine) { + if (layerStateMachine == null) return null; + var cacheKey = new KeyValuePair(basePath, layerStateMachine); if (_stateMachines.TryGetValue(cacheKey, out var asm))