Copyright © 2026 Unity Technologies
Steps to reproduce:
1. Create new Unity project using Universal 3D Template
2. In Hierarchy create Button object (Right-click > UI Toolkit > Standard Elements > Button)
3. In “Open UI stage” pop-up press “Continue” and save UXML file
4. Press “<“ button to go back to Editor’s Hierarchy window
5. Save changes
6. Expand “New UXML” element in Hierarchy
7. Select “New UXML” and “New UXML.uxml” objects in Hierarchy
Delete them
8. Observe the Console window
Actual results: “MissingReferenceException: The object of type 'UnityEngine.UIElements.PanelRenderer' has been destroyed but you are still trying to access it.” Error is thrown in the Console window
Expected results: No errors are thrown in the Console window
Reproducible with versions: 6000.6.0b1, 6000.6.0b6, 6000.7.0a3
Can’t test with versions: 6000.0.80f1, 6000.3.21f1, 6000.5.6f1, 6000.6.0a7 (UI Authoring not available)
Tested on (OS): macOS Tahoe 26.5.2 (M1), Ubuntu 24.04
MissingReferenceException: The object of type 'UnityEngine.UIElements.PanelRenderer' 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. UnityEngine.Object+MarshalledUnityObject.TryThrowEditorNullExceptionObject (UnityEngine.Object unityObj, System.String parameterName) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnityEngineObject.bindings.cs:1174) UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException (System.Object obj) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/BindingsHelpers.cs:21) UnityEngine.UIElements.PanelRenderer.get_nativeVisualTreeAsset () (at <f1fa76ad5309429ea47056b33d9114dc>:0) UnityEngine.UIElements.PanelRenderer.get_visualTreeAsset () (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Native/Renderer/PanelRenderer.bindings.cs:81) Unity.UIToolkit.Editor.VisualTreeAssetSelectionEditor.CreateInspectorGUI () (at /Users/bokken/build/output/unity/unity/Modules/UIToolkitAuthoringEditor/Managed/Hierarchy/Selection/Editor/VisualTreeAssetSelectionEditor.cs:18) UnityEditor.UIElements.InspectorElement.CreateInspectorElementUsingUIToolkit (UnityEditor.Editor targetEditor) (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Inspector/InspectorElement.cs:697) UnityEditor.UIElements.InspectorElement.CreateInspectorElementFromSerializedObject (UnityEditor.SerializedObject bindObject) (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Inspector/InspectorElement.cs:520) UnityEditor.UIElements.InspectorElement.HandleEventBubbleUp (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Inspector/InspectorElement.cs:404) UnityEngine.UIElements.EventDispatchUtilities.HandleEventAtTargetAndDefaultPhase (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventDispatchUtilities.cs:129) UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.SendBindingEvent[TEventType] (TEventType evt, UnityEngine.UIElements.VisualElement target) (at /Users/bokken/build/output/unity/unity/Modules/UIElementsEditor/Bindings/SerializedObjectBindingContext.cs:134)
Issues you vote on will appear here