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
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
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.