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
- Search field in UI Builder's Library has no character limit
- Changing the value in UI Builder by dragging increases it by a few thousand points when reaching the borders of the screen
- ARM64 architecture DLL incorrectly copied instead of x64 when building for Windows x64
- Crash on TypeTreeIterator::GetNode when opening a specific folder
- Crash on WriteSerializedAssetsV2 when (re)entering the Play Mode in a specific project when IEnumerator Start() is used
Add comment