diff --git a/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/AacFlStates.cs b/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/AacFlStates.cs index 4f49462..2b9e34e 100644 --- a/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/AacFlStates.cs +++ b/Packages/dev.hai-vr.animator-as-code.v1/V1/Editor/AacFlStates.cs @@ -1038,11 +1038,17 @@ namespace AnimatorAsCode.V1 public static implicit operator AacTransitionEndpoint(AnimatorState state) { + // We don't want a null AnimatorState to become an AacTransitionEndpoint that contains null in it + if (state == null) return null; + return new AacTransitionEndpoint(state); } public static implicit operator AacTransitionEndpoint(AnimatorStateMachine stateMachine) { + // We don't want a null AnimatorStateMachine to become an AacTransitionEndpoint that contains null in it + if (stateMachine == null) return null; + return new AacTransitionEndpoint(stateMachine); }