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
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
Add comment