Reproduction steps:
1. Open the attached “AnimatorIssue.zip“ project
2. Open the “Assets/Scenes/SampleScene.unity“ Scene
3. In the Hierarchy window click on “Animated Cube” GameObject
4. Open the Animator tab
5. In the Layers view click on “SyncedLayer”
6. Double-click on the “CubeMotion” sub-state
7. Double-click on the “CubeMotion1” sub-state
8. Click on the “New State”
9. In the Inspector window select “New State -> Exit”
10. Observe the Console window
Expected result: No exception is thrown
Actual result: NullReferenceException is thrown
Reproducible with: 2022.2.4f1, 2022.2.21f1, 2022.3.17f1, 2023.2.4f1, 2023.3.0b1
Not reproducible with: 2021.3.34f1, 2022.2.3f1
Reproducible on: Windows 11
Not reproducible on: No other environment tested
Note:
Not reproducible in the base layer
Exception:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Graphs.AnimationStateMachine.AnimatorStateTransitionInspector.DoPreview () (at <febdb45aa296413abfcf2c3a8bf64398>:0)
UnityEditor.Graphs.AnimationStateMachine.AnimatorTransitionInspectorBase.OnInspectorGUI () (at <febdb45aa296413abfcf2c3a8bf64398>:0)
UnityEditor.Graphs.AnimationStateMachine.SourceNodeTransitionEditor.OnInspectorGUI () (at <febdb45aa296413abfcf2c3a8bf64398>:0)
UnityEditor.Graphs.AnimationStateMachine.StateEditor.OnInspectorGUI () (at <febdb45aa296413abfcf2c3a8bf64398>:0)
UnityEditor.UIElements.InspectorElement+<>c_DisplayClass72_0.<CreateInspectorElementUsingIMGUI>b_0 () (at <a445319feeee47ac85466210448edf2f>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)