Search Issue Tracker

Fixed in 2019.1.X

Fixed in 2018.3.X

Votes

0

Found in

2019.1.0a11

Issue ID

1105087

Regression

Yes

NullReferenceException error appears after running tests from the Test Runner window after running tests in Player

Unity Test Runner

-

Steps to reproduce:
1. Open attached Unity project
2. Open Test Runner window
3. Press 'Run all in player'
4. After tests are ran in player, double click on a test in Test Runner window to run it

Expected results: No errors appear
Actual results: A NullReferenceException error appears

Reproducible with: 2019.1.0a11
Not reproducible with: 2019.1.0a10

Full error:
NullReferenceException: Object reference not set to an instance of an objectUnityEditor.TestTools.TestRunner.GUI.TestListGUI.TestSelectionCallback (System.Int32[] selected) (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEditor.TestRunner/GUI/Views/TestListGUIBase.cs:236)UnityEditor.TestTools.TestRunner.TestRunnerWindow.OnPlayModeStateChanged (PlayModeStateChange state) (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEditor.TestRunner/TestRunnerWindow.cs:95)UnityEditor.EditorApplication.Internal_PlayModeStateChanged (PlayModeStateChange state) (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:302)

Comments (7)

  1. ProtoTerminator

    Mar 26, 2023 11:00

    Interestingly, restarting the editor made the error stop showing for me.

  2. nmg_spade

    Jan 20, 2023 18:18

    Did you guys find a fix for this? I am also getting the issue

  3. duc_unity577

    Nov 03, 2022 11:29

    I'm having this issue again after upgrading test framework
    `"com.unity.test-framework": "1.1.31"`: **no issue**
    `"com.unity.test-framework": "1.1.33"`: **this exception is thrown after any play mode test run** (when ending the test)

  4. daicoden

    Oct 21, 2022 00:59

    2021.3.6f1 - still happening.

    ```
    internal static PlaymodeTestsController GetController()
    {
    return GameObject.Find(kPlaymodeTestControllerName).GetComponent<PlaymodeTestsController>();
    }
    ```

    That PlaymodeTestController is returning a version where m_Runner is set to null. Like it was the setup for a next test, when there is no next test.

  5. JesusGonzalezRodriguez

    Mar 01, 2022 14:40

    This is happening with me in version 2020.3.29f1

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.TestTools.TestRunner.PlaymodeLauncher+BackgroundWatcher.OnPlayModeStateChanged (UnityEditor.PlayModeStateChange state)

  6. dcolladoubm

    May 11, 2021 12:54

    This happens in 2020.3.5f1, any ideas if this will be fixed for the 2020.3 LTS?

  7. samvermeirVRT

    Jul 17, 2019 12:31

    I'm using 2018.3.11f and I have the same error. it is not blocking or anything but it is an error that could be resolved, although i have no idea how...

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.