Search Issue Tracker

By Design

Votes

0

Found in

2021.3.34f1

2022.3.17f1

2023.2.5f1

2023.3.0b3

Issue ID

UUM-60620

Regression

No

NullReferenceException is thrown when opening a custom UI Toolkit Editor Window

--

-

Reproduction steps:

1. Open the attached “Repro“ project
2. Open the Custom Editor Window (Window > UI Toolkit > MyCustomEditor)
3. Observe the Window and Console

Expected result: No errors/logs are present and there's a Button and a Toggle in the MyCustomEditor Window
Actual result: NullReferenceException is thrown and there are no Button or Toggles seen in the MyCustomEditor Window

Reproducible with: 2021.3.34f1, 2022.3.17f1, 2023.2.5f1, 2023.3.0b3

Reproducible on: M1 MacOS 14.2
Not reproducible on: No other environment tested

  1. Resolution Note:

    The NullReferenceException occurs because no VisualTreeAsset was assigned on the MyCustomEditor script. To fix it, click the MyCustomEditor.cs asset in the Project Window, and assign a VisualTreeAsset to the field in the Inspector Window.

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.