How to reproduce:
1. Open the "OnBeforeSerializeError 2" project
2. In the Project window right-click on the “SomePrefab” Asset and select “Reimport”
3. Observe the Console
Expected result: No errors are thrown
Actual result: The “ArgumentNullException: Value cannot be null.” error is thrown
Reproduced with: 2021.3.33f1, 2022.3.14f1, 2023.2.2f1, 2023.3.0a16
Reproduced on: macOS 14.1.1 (M1) (by reporter), Windows 11
Not reproducible on: No other environment tested
Notes:
1. Only reproducible when the Prefab has a script attached that calls “PrefabUtility.IsPartOfPrefabAsset(this)”
2. The Asset is still usable even after the error
Full error thrown to the Console: