[SDK 3.7.2] Avatar with spurious unityPackage crashes VRCSdkControlPanelAvatarBuilder::HandleAvatarSwitch()
Shhasum
VRChat version:
VRCSDK 3.7.2
Description of the bug:
Having a previously-uploaded package on an avatar with an invalid platform causes KeyNotFoundException to be thrown in VRCSdkControlPanelAvatarBuilder::HandleAvatarSwitch(), making it impossible to upload new changes without intervention.
Steps to reproduce:
- Visit the Builder tab on an (owned) avatar which contains invalid platforms in its unityPackages list.
- Note that the Builder tab breaks and an exception is thrown.
Details:
I have an avatar (avtr_b5467405-9705-4309-aff5-4e9340747184) that I originally uploaded back in Jan 2022, which has an extra package (unp_53006459-5ce8-48e9-bc4b-8c79affedede) in its unityPackages list, probably due to some mishap when I initially uploaded it. (If I recall, I was still figuring out how to get Unity set up properly on my Mac at the time, and likely managed to upload a native mac package rather than a standalonewindows package somehow.)
The API is returning "unknownplatform" for this package's platform, which trips up line 1595 of VRCSdkControlPanelAvatarBuilder.cs. It uses platform as a lookup on the VRCSdkControlPanel.CONTENT_PLATFORMS_MAP dictionary, which only contains known valid platforms, rather than all possible values. If an unexpected platform is encountered, it throws a KeyNotFoundException and the routine never finishes, leaving the Builder tab in a partially-disabled and broken state.
Log In