Search Issue Tracker
Duplicate
Votes
0
Found in [Package]
Issue ID
1401604
Regression
No
NullReferenceException when exiting PlayMode in test
How to reproduce:
1. Open attached Unity project
2. Open Test Runner window
3. Select PlayMode tests
4. Run tests
5. Observe console
Expected result: PlayMode exists successfully.
Actual result: NullReferenceException is thrown.
Reproduced with: 2022.2.0a4, 2022.2.0a1, 2022.1.0b7, 2022.1.0a1, 2021.2.11f1, 2021.2.0a1, 2020.3.29f1, 2020.3.0f1, 2019.4.36f1, 2019.4.0f1.
Full error:
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.TestTools.TestRunner.PlaymodeTestsController+<TestRunnerCoroutine>d__15.MoveNext () (at Library/PackageCache/com.unity.test-framework@1.1.30/UnityEngine.TestRunner/TestRunner/PlaymodeTestsController.cs:74)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <84f51b1b0ff2473ca787c217e1eda8b9>:0)
Notes:
This mostly causes issues when there is DontDestroyOnLoad object with a static value in a scene. It remains through all the tests and it's not unloaded between tests.
In the attached image you can see that test fails because it's canceled by user.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Disabled assets in Import Unity Package window aren't tracked but count as being selected by user
- [Windows] Crash on GetManagerFromContext when video is playing and creating High Definition 3D Projects after FMOD failed to switch back to normal output Error appeared
- GC Alloc produced when adding items to MultiColumnListView with Auto Assign Binding
- Mouse and Pointer Events are called incorrectly in ScrollView with XRUIInputModule
- Memory leak occurs when repeatedly minimizing and maximizing the UI Builder window
Add comment