Search Issue Tracker
Fixed in 2021.2.X
PrefabUtility.SaveAsPrefabAsset() returns null when creating new prefab on AssetPostprocessor.OnPostProcessAllAssets()
1. Open the attached project inside of "PrefabUtilitySaveAsAssetIssue.zip"
2. Delete "untitled_prefabroot" Prefab Asset if it exists (Might appear due to reimport)
3. Right-click on "untitled" Asset and click on "Reimport"
Expected result: No ArgumentNullExceptions are thrown inside the Console log
Actual result: ArgumentNullException is thrown inside the Console log
Reproduces on: 2018.3.12f1, 2019.1.0f1, 2019.2.0a11
- PrefabUtility.SaveAsPrefabAsset() was introduced as of 2018.3.0a6
- PrefabUtility.SaveAsPrefabAsset() overload with success boolean returns "true" even when method returns null
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Windows Player exe contains unwanted properties, causing text "Unity Playback Engine" to appear in task bar when mousing over it
- Changes made by the Script in the UI Document are reset when performing an Undo operation after changing the GameObject with this Script
- Emissive materials are broken when loading Scene via SceneManager.LoadScene
- [URP] [Decals] ProxyLighting Decal shader doesn't work in Screen Space Technique
- "Pin in New Scene Dialog" option position migrates with "Inspector" window resizing