Copyright © 2026 Unity Technologies
Steps to reproduce:
1. Create new Unity project using Universal 2D Template
2. In Hierarchy create Video Player Element object (Right-click > UI Toolkit > Standard Elements > UI Library > Custom > Video Player Element)
3. In “Open UI stage” pop-up press “Continue” and save UXML file
4. Once saved, observe the Console window
Actual results: “NullReferenceException: Object reference not set to an instance of an object” unclearable errors are spammed in the Console window
Expected results: No errors are spammed in the Console window
Reproducible with versions: 6000.6.0b4, 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), 6000.6.0b1 - 6000.6.0b3 (no Video Player Element)
Tested on (OS): macOS Tahoe 26.5.2 (M1), Ubuntu 24.04
NullReferenceException: Object reference not set to an instance of an object Unity.Tutorials.Editor.VideoPlayerElement.OnAttachedToPanel (UnityEngine.UIElements.AttachToPanelEvent evt) (at ./Library/PackageCache/com.unity.learn.iet-framework@20adddfea631/Editor/UI/CustomControls/VideoPlayer/VideoPlayerElement.cs:231) UnityEngine.UIElements.EventBase`1[T].InvokeCallback (System.Delegate userCallback) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventBase.cs:750) UnityEngine.UIElements.EventNoArgValue.Invoke (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.EventCallbackInternal c) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventCallback.cs:149) UnityEngine.UIElements.EventCallbackRegistry+DynamicCallbackList.Invoke (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target, UnityEngine.UIElements.EventCallbackRegistry registry) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventCallbackRegistry.cs:379) 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:137) UnityEngine.UIElements.VisualElement.HasChangedPanel (UnityEngine.UIElements.BaseVisualElementPanel prevPanel) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/VisualElement.cs:2274) UnityEngine.UIElements.VisualElement.SetPanelBatched (UnityEngine.UIElements.BaseVisualElementPanel p, System.Collections.Generic.List`1[T] elements) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/VisualElement.cs:2189)
Issues you vote on will appear here