Search Issue Tracker

Active

Under Consideration for 2021.3.X, 2022.3.X, 6000.0.X

Votes

0

Found in

2021.3.40f1

2022.3.40f1

6000.0.13f1

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()
**

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.