Steps to reproduce:
  1. Open the VRChat SDK Control Panel on the Builder tab.
  2. Have a scene open with no VRC_SceneDescriptor.
  3. Load a different scene that does have a VRC_SceneDescriptor (single, not additive).
Expected: the panel refreshes and shows the new world.
Actual: IndexOutOfRangeException at VRCSdkControlPanelWorldBuilder.cs:194, called from OnSceneChanged (line 113) -> RunValidationsHandler -> RunValidations (VRCSdkControlPanelBuilder.cs:883). After that the panel stays broken. More errors follow: "Assertion failed", a NullReferenceException in the DetachFromPanelEvent callback in ShowBuilders (VRCSdkControlPanelBuilder.cs:848), and a NullReferenceException in Modal.SetAnchor (Modal.cs:191) from ThumbnailBlock / CreateContentInfoGUI (VRCSdkControlPanelWorldBuilder.cs:1364). The NullReferenceException at line 848 also fires when the panel is closed. Closing and reopening the panel fixes it.
Cause (from the SDK source):
In CreateValidationsGUI:
if (_scenes[0] == null) { FindScenes(); }
if (_scenes[0] == null) { root.Clear(); return; } // line 194
FindScenes() sets _scenes to the result of Tools.FindSceneObjectsOfTypeAll<VRC_SceneDescriptor>(). When the scene being changed to has no descriptor yet (or the old scene has none), that array is empty, and _scenes[0] throws instead of returning null. The guard should be something like:
if (_scenes == null || _scenes.Length == 0 || _scenes[0] == null)
The DetachFromPanelEvent handler at VRCSdkControlPanelBuilder.cs:848 then dereferences _selectedBuilder (or a related field) without a null check, so tearing down the half-built UI throws as well.
Stack trace (first error):
IndexOutOfRangeException: Index was outside the bounds of the array.
VRC.SDK3.Editor.VRCSdkControlPanelWorldBuilder.CreateValidationsGUI (UnityEngine.UIElements.VisualElement root) (at ./Packages/com.vrchat.worlds/Editor/VRCSDK/SDK3/VRCSdkControlPanelWorldBuilder.cs:194)
VRCSdkControlPanel.RunValidations () (at ./Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/ControlPanel/VRCSdkControlPanelBuilder.cs:883)
VRCSdkControlPanel.RunValidationsHandler (System.Object sender, System.EventArgs e) (at ./Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/ControlPanel/VRCSdkControlPanelBuilder.cs:888)
VRC.SDK3.Editor.VRCSdkControlPanelWorldBuilder.OnSceneChanged (UnityEngine.SceneManagement.Scene oldScene, UnityEngine.SceneManagement.Scene newScene) (at ./Packages/com.vrchat.worlds/Editor/VRCSDK/SDK3/VRCSdkControlPanelWorldBuilder.cs:113)
UnityEditor.SceneManagement.EditorSceneManager.Internal_ActiveSceneChangedInEditor (...)
Workaround: close the VRChat SDK Control Panel and reopen it from VRChat SDK > Show Control Panel.