Search Issue Tracker
Fixed
Fixed in 2022.2.0b9, 2023.1.0a7
Votes
1
Found in
2022.2.0b4
2023.1.0a6
Issue ID
UUM-11315
Regression
Yes
NullReferenceException: Object reference not set to an instance of an object errors whenever anything is done in UI Builder
How to reproduce:
1. Open up any project
2. Create a UI Document in Hierarchy and Project Browser
3. Drag and drop UI Document from Project Browser into the Source Asset slot of UI Document in Hierarchy
4. Double click UI Document in Project Browser
5. Add any element to the UI
6. Close and save the UI Builder tab
7. Open the source Asset again
Expected result: No errors are logged in Console
Actual result: NullReferenceException errors thrown in Console
Reproducible with: 2022.2.0a15, 2022.2.0b4, 2023.1.0a5
Not reproducible with: 2021.3.8f1, 2022.1.13f1, 2022.2.0a14
Couldn't test with: 2020.3.37f1 (No UI builder by default)
Tested on: Windows 11
Notes:
1. Exceptions are thrown whenever any objects are added to the UI, when opening up UI Builder window
2. Reproduction might be inconsistent, if so, try closing UI Builder and opening up the Source Asset again
Error messages:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.UIElements.EditorPanel.OnUpdateMaterial (UnityEngine.Material mat) (at <e45af29d3071404fb85246d308473d3a>:0)
UnityEngine.UIElements.BaseVisualElementPanel.InvokeUpdateMaterial (UnityEngine.Material mat) (at <8c4c0c3614e7457984f7ec0d5dc10278>:0)
UnityEngine.UIElements.UIR.RenderChain.Render () (at <8c4c0c3614e7457984f7ec0d5dc10278>:0)
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.UIElements.UIRRepaintUpdater.InitRenderChain () (at <8c4c0c3614e7457984f7ec0d5dc10278>:0)
UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <8c4c0c3614e7457984f7ec0d5dc10278>:0)
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
- Standard Unity Materials and Shaders become corrupted after importing specific Asset Packages
- [Linux][OpenGL][Vulkan] Draw calls are not shown in the Event List when taking a capture of a frame with RenderDoc
- Inaccurate collision detections when Rigidbody Collision Detection is set to "Continuous" or "Continuous Dynamic"
- Crash on Object::IncrementPersistentDirtyIndex when upgrading project version
- [iOS] Multiple Xcode project instances created before opens up when performing Build and Run for iOS Platform
Resolution Note (fix version 2023.1.0a7):
Fixed in 2023.1.0a7 and onwards
Resolution Note (fix version 2022.2.0b9):
Errors no longer appear on 2022.2.0b9