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
- Unity CIL Linker fails on Player build when persistent listeners have "<" and ">" in their XML attribute names
- ”Lighting data asset ‘LightingData’ is incompatible with the current Unity version…” warnings are thrown when saving Indoors (URP) and Outdoors (URP) Scenes as Scene Templates
- [iOS] The screen blinks when transitioning from custom to Unity splash screen
- [macOS] ”Ignoring depth surface load action as it is memoryless” warnings are thrown when taking Game View Snapshot
- UI Builder Inspector scrolls back up when changes on an expanded but not fully displayed Inspector tab are saved
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.