Search Issue Tracker

Fixed in 2021.3.21f1

Fixed in 2021.3.X, 2022.2.X, 2023.1.X, 2023.1.0a22

Votes

1

Found in

2021.3.14f1

2022.1.23f1

2023.1.0a18

Issue ID

UUM-19168

Regression

No

[Forma Render] NullReferenceException in UnityEngine.UIElements.PanelRaycaster.Raycast during runtime

UI Toolkit Graphics

-

Reproduction steps:
1. Open the “Validation“ project
2. Enter the Play Mode
3. Observe the Console

Expected result: no NullReferenceException
Actual result: a NullReferenceException

Reproduced in: 2021.3.14f1, 2022.1.23f1
Could not test in: 2020.3.42f1, 2022.2.0b14, 2023.1.0a19 (project issues after downgrade/upgrade)

Reproduced using: macOS Monterey 12.0.1 (Intel), Windows 10

Notes:

  • The reporter also reproduced in 2023.1
  • Sometimes the error does not occur
  • Could not test a Player due to UI failing to load in it

Full error:

NullReferenceException: Object reference not set to an instance of an object

UnityEngine.UIElements.PanelRaycaster.Raycast (UnityEngine.EventSystems.PointerEventData eventData, System.Collections.Generic.List`1[T] resultAppendList) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/UIElements/PanelRaycaster.cs:108)

UnityEngine.EventSystems.EventSystem.RaycastAll (UnityEngine.EventSystems.PointerEventData eventData, System.Collections.Generic.List`1[T] raycastResults) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:263)

UnityEngine.EventSystems.PointerInputModule.GetMousePointerEventData (System.Int32 id) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/InputModules/PointerInputModule.cs:295)

UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent (System.Int32 id) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/InputModules/StandaloneInputModule.cs:540)

UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/InputModules/StandaloneInputModule.cs:526)

UnityEngine.EventSystems.StandaloneInputModule.Process () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/InputModules/StandaloneInputModule.cs:280)

UnityEngine.EventSystems.EventSystem.Update () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:501)

  1. Resolution Note (fix version 2022.2):

    Fixed in 2022.2.21f1

  2. Resolution Note (fix version 2021.3):

    Fixed in 2021.3.21f1

Add comment

Log in to post comment