Steps to reproduce:
- Open any Project and install the AI Packages via the AI Button in Editors Toolbar
- In the Project Browser create and a UI Document UXML, select it and make sure that the Preview is open in the Inspector
- Open the Project Settings for UI Toolkit and at the bottom switch the "Runtime" Theme to the "App UI - Dark - Large" Theme
- Close the Editor
- Open the same Project and select the created UI Document UXML Asset
Actual results: The Preview in the Inspector flickers, Errors are logged:
"NullReferenceException: Object reference not set to an instance of an object
UnityEditor.UIElements.VisualTreeAssetEditor.DrawPreviewThemeDropdown () (at :0)"
"ArgumentException: Getting control 1's position in a group with only 1 controls when doing repaint
Aborting"
Expected results: Project Settings are loaded without Errors for the Preview Theme Dropdown
Reproducible with versions: 6000.5.0a6
Can’t test with versions: 6000.0.67f1, 6000.3.8f1, 6000.4.0b8 (No Preview Theme Dropdown menu feature)
Tested on (OS): Windows 11