Search Issue Tracker
Fixed
Fixed in 2022.3.58f1, 6000.0.38f1, 6000.1.0b6, 6000.2.0a2, 7000.0.0a17
Votes
0
Found in
2021.3.40f1
2022.3.40f1
6000.0.13f1
6000.1.0a7
6000.2.0a1
7000.0.0a1
Issue ID
UUM-76821
Regression
No
NullReferenceException is thrown when undoing Selector deletion in Isolation
Steps to reproduce:
- Create or open any Project with the UI Toolkit installed
- Create a "UI Document" Asset and open it
- Add any UI Element to the Hierarchy
- Right click it and select "Create Template" and select it
- Create and attach a StyleSheet with a Selector added to it
- Right click the Template in the Hierarchy and select "Open Instance in Isolation"
- In the StyleSheets section, select a greyed out Selector, right click to delete it
- Undo
Actual results: "NullReferenceException: Object reference not set to an instance of an object" is thrown
Expected results: No Errors are thrown
Reproducible with versions: 2021.3.40f1, 2022.3.40f1, 6000.0.13f1
Tested on (OS): macOS Sonoma, Windows 11
Error message:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.StyleSheets.ConverterUtils.FindProperty (UnityEngine.UIElements.StyleComplexSelector selector, System.String propertyName) (at <284b2bcf4ed84f27916114fd162acc12>:0)
Unity.UI.Builder.StyleComplexSelectorExtensions.IsSelected (UnityEngine.UIElements.StyleComplexSelector scs) (at <dfb6f584aa494374b9127edd7bcf5d6d>:0)
Unity.UI.Builder.VisualElementExtensions.IsSelected (UnityEngine.UIElements.VisualElement element) (at <dfb6f584aa494374b9127edd7bcf5d6d>:0)
Unity.UI.Builder.VisualElementExtensions.FindSelectedElementsRecursive (UnityEngine.UIElements.VisualElement parent, System.Collections.Generic.List`1[T] selected) (at <dfb6f584aa494374b9127edd7bcf5d6d>:0)
Unity.UI.Builder.VisualElementExtensions.FindSelectedElementsRecursive (UnityEngine.UIElements.VisualElement parent, System.Collections.Generic.List`1[T] selected) (at <dfb6f584aa494374b9127edd7bcf5d6d>:0)
Unity.UI.Builder.VisualElementExtensions.FindSelectedElementsRecursive (UnityEngine.UIElements.VisualElement parent, System.Collections.Generic.List`1[T] selected) (at <dfb6f584aa494374b9127edd7bcf5d6d>:0)
Unity.UI.Builder.VisualElementExtensions.FindSelectedElementsRecursive (UnityEngine.UIElements.VisualElement parent, System.Collections.Generic.List`1[T] selected) (at <dfb6f584aa494374b9127edd7bcf5d6d>:0)
Unity.UI.Builder.VisualElementExtensions.FindSelectedElements (UnityEngine.UIElements.VisualElement element) (at <dfb6f584aa494374b9127edd7bcf5d6d>:0)
Unity.UI.Builder.BuilderSelection.RestoreSelectionFromDocument (UnityEngine.UIElements.VisualElement sharedStylesAndDocumentElement) (at <dfb6f584aa494374b9127edd7bcf5d6d>:0)
Unity.UI.Builder.Builder.OnEnableAfterAllSerialization () (at <dfb6f584aa494374b9127edd7bcf5d6d>:0)
Unity.UI.Builder.Builder.OnUndoRedo () (at <dfb6f584aa494374b9127edd7bcf5d6d>:0)
Unity.UI.Builder.BuilderCommandHandler.OnUndoRedo (UnityEditor.UndoRedoInfo& info) (at <dfb6f584aa494374b9127edd7bcf5d6d>:0)
UnityEditor.Undo.Internal_CallUndoRedoEvent (UnityEditor.UndoRedoInfo undoInfo) (at <284b2bcf4ed84f27916114fd162acc12>:0)
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()
**
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Linux] Screen.SetResolution immediately applies windowed resolution when switching from Fullscreen to Windowed mode
- Lighting window allows non-cube map texture for Environment Reflections, throwing invalid texture type (2D) error
- Console warning “MismatchingRepositoryProjectMessage” when creating a new Unity Version Control workspace
- [Ubuntu] VFX Graph Enum Value menu stretches across screen when entered long Enum Value
- Unclear warning message in Rendering Debugger about the Play mode Debugger Overlay
Add comment