Search Issue Tracker
Fixed in 2022.2.0b9
Fixed in 2022.2.X, 2023.1.X, 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
- A gap at the bottom of the screen appears when entering Play mode in full screen
- Redoing creation of Sub Scenes and Cube GameObjects in Hierarchy throws “Assertion failed on expression: 'targetScene != nullptr’” error in Console window
- Selecting “New Sub Scene” after assigning “New Scene” in Sub Scene Script Component throws “Destroying GameObjects immediately is not permitted” in the Console window
- Group Selection title text size is smaller in renaming than the actual font size
- Rich Text is not correctly highlighted when searching through Debug Logs in the Console window
Resolution Note (fix version 2023.1):
Fixed in 2023.1.0a7 and onwards
Resolution Note (fix version 2022.2):
Errors no longer appear on 2022.2.0b9