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
- Inspector window flickers when a selector is created using a Style Class List Section
- [iOS] "UnityBatchPlayerLoop()" causes a freeze in the iOS application when it is put to the background and brought back to the foreground
- "Perform Selected" of Shortcut Manager window does not perform the shortcut in some cases
- Crash on mono_get_hazardous_pointer when running Play Mode tests in a specific project
- [iOS] ‘확인’(Done) and '취소'(Cancel) text is displayed as '...' in the on-screen keyboard when the System preferred language is set to Korean
Add comment