Copyright © 2026 Unity Technologies
Steps to reproduce:
1. Create and open a new project using Universal 3D Template
2. Open Edit > Project Settings > UI Toolkit and enable Enable StyleSheet Editing Mode
3. In the Project window, create a Style Sheet (Create > UI Toolkit > Style Sheet (USS))
4. Double-click the .uss asset to open it in the UI Builder
5. In the Project window, delete that .uss asset
6. Back in UI Builder window click on “VisualElement” and on the stylesheet row in the StyleSheets pane
7. Observe the UI Builder window and Console window
Actual results: After deleting the USS asset from the Project window while it is open in UI Builder's StyleSheet Editing Mode, clicking the VisualElement or the stylesheet row in the StyleSheets pane throws "ArgumentNullException" and "MissingReferenceException" errors in the Console
Expected results: Deleting an Asset that is currently open in UI Builder should prompt the user to confirm the deletion and warn that unsaved changes will be discarded. After deletion, the UI Builder should prevent further interaction with the destroyed asset, no exceptions should be thrown
Reproducible with versions: 6000.7.0b1, 7000.0.0a1
Can’t test with versions: 6000.6.2f1 and lower (Feature not available)
Tested on (OS): macOS 26.6.1 (Apple silicon)
MissingReferenceException: The object of type 'UnityEngine.UIElements.StyleSheet' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object. Parameter name: identifier UnityEngine.Object+MarshalledUnityObject.TryThrowEditorNullExceptionObject (UnityEngine.Object unityObj, System.String parameterName) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnityEngineObject.bindings.cs:1195) UnityEngine.Bindings.ThrowHelper.ThrowArgumentNullException (System.Object obj, System.String parameterName) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/BindingsHelpers.cs:13) UnityEditor.Undo.RegisterCompleteObjectUndoMultiple (UnityEngine.Object identifier, UnityEngine.Object[] objectsToUndo, System.String name, System.Int32 namePriority) (at <10361a91a4f24b68b02b65ad4e2ecf99>:0) UnityEditor.Undo.RegisterCompleteObjectUndo (UnityEngine.Object objectToUndo, System.String name) (at /Users/bokken/build/output/unity/unity/Editor/Mono/Undo/Undo.bindings.cs:92) Unity.UI.Builder.StyleSheetExtensions.AddSelector (UnityEngine.UIElements.StyleSheet styleSheet, System.String complexSelectorStr, System.String undoMessage) (at /Users/bokken/build/output/unity/unity/Modules/UIBuilder/Editor/Utilities/StyleSheetExtensions/StyleSheetExtensions.cs:154) Unity.UI.Builder.SelectionUtility.AddToSelection (UnityEngine.UIElements.StyleSheet styleSheet) (at /Users/bokken/build/output/unity/unity/Modules/UIBuilder/Editor/Utilities/Selection/SelectionUtility.cs:57) Unity.UI.Builder.SelectionUtility.AddElementToSelectionInAsset (Unity.UI.Builder.BuilderDocument document, UnityEngine.UIElements.VisualElement ve) (at /Users/bokken/build/output/unity/unity/Modules/UIBuilder/Editor/Utilities/Selection/SelectionUtility.cs:126)
ArgumentNullException: Value cannot be null. Parameter name: identifier UnityEditor.Undo.RegisterCompleteObjectUndoMultiple (UnityEngine.Object identifier, UnityEngine.Object[] objectsToUndo, System.String name, System.Int32 namePriority) (at <10361a91a4f24b68b02b65ad4e2ecf99>:0) UnityEditor.Undo.RegisterCompleteObjectUndo (UnityEngine.Object objectToUndo, System.String name) (at /Users/bokken/build/output/unity/unity/Editor/Mono/Undo/Undo.bindings.cs:92) Unity.UI.Builder.StyleRuleExtensions.AddProperty (UnityEngine.UIElements.StyleSheet styleSheet, UnityEngine.UIElements.StyleRule rule, System.String name, System.String undoMessage, System.Boolean undo) (at /Users/bokken/build/output/unity/unity/Modules/UIBuilder/Editor/Utilities/StyleSheetExtensions/StyleRuleExtensions.cs:21) Unity.UI.Builder.SelectionUtility.AddToSelection (UnityEngine.UIElements.StyleSheet styleSheet, UnityEngine.UIElements.StyleComplexSelector scs) (at /Users/bokken/build/output/unity/unity/Modules/UIBuilder/Editor/Utilities/Selection/SelectionUtility.cs:77) Unity.UI.Builder.SelectionUtility.AddElementToSelectionInAsset (Unity.UI.Builder.BuilderDocument document, UnityEngine.UIElements.VisualElement ve) (at /Users/bokken/build/output/unity/unity/Modules/UIBuilder/Editor/Utilities/Selection/SelectionUtility.cs:132) Unity.UI.Builder.BuilderSelection.AddToSelection (Unity.UI.Builder.IBuilderSelectionNotifier source, UnityEngine.UIElements.VisualElement ve, System.Boolean undo, System.Boolean sort) (at /Users/bokken/build/output/unity/unity/Modules/UIBuilder/Editor/Builder/BuilderSelection.cs:315) Unity.UI.Builder.BuilderSelection.AddToSelection (Unity.UI.Builder.IBuilderSelectionNotifier source, UnityEngine.UIElements.VisualElement ve) (at /Users/bokken/build/output/unity/unity/Modules/UIBuilder/Editor/Builder/BuilderSelection.cs:299)
Issues you vote on will appear here