How to reproduce:
1. Open the attached project "APBuildProfileCopyPaste_Bugs1to6"
2. Go to Build Profiles -> create a Build Profile -> add the "Adaptive Performance" setting
3. Select the Build Profile asset in the Project window
4. In the Unity toolbar, go to QA -> AP Copy-Paste -> Bug 1 - invalid payload destroys settings
5. Observe the Console
Expected results: The paste is rejected and the profile's Adaptive Performance settings are left unchanged
Actual results: "ArgumentNullException: Value cannot be null. Parameter name: newAsset" error is thrown and all Adaptive Performance settings are removed from the Build Profile
Reproducible with: 6000.7.0a6
Reproducible on: Ubuntu 24.04.4 LTS (Intel i9-10980XE), macOS Tahoe 26 (M1)
Not reproducible on: No other environment tested
Note: The menu item copies the profile's own payload and replaces the first "typeName" with an
abstract ScriptableObject before applying it, then reports the object count before and after and
the exception raised. Measured: 6 objects -> 1, ArgumentNullException at
AdaptivePerformanceSettingProvider.cs:215.
First lines of error:
ArgumentNullException: Value cannot be null. Parameter name: newAsset
at UnityEditor.AssetDatabase.AddObjectToAsset_Obj (UnityEngine.Object newAsset, UnityEngine.Object sameAssetFile) [0x00003] in <c0109126767b493699757baf7816b7b5>:0
at UnityEditor.AssetDatabase.AddObjectToAsset (UnityEngine.Object objectToAdd, UnityEngine.Object assetObject) [0x00000] in /home/bokken/build/output/unity/unity/Modules/AssetDatabase/Editor/ScriptBindings/AssetDatabase.bindings.cs:391 at UnityEditor.Build.Profile.AdaptivePerformance.AdaptivePerformanceSettingProvider.ApplyPayload (UnityEditor.Build.Profile.BuildProfile profile, System.String clipboard) [0x001b3] in /home/bokken/build/output/unity/unity/Modules/BuildProfileEditor/Elements/Settings/AdaptivePerformanceSettingProvider.cs:215