Search Issue Tracker

Active

Under Consideration for 2022.2.X, 2023.1.X, 2023.2.X

Votes

0

Found in

2022.1.20f1

2022.2.0b10

2023.1.0a13

2023.2.0a1

Issue ID

UUM-16824

Regression

No

[Undo] Undoing prefab instancing leaves ghost objects in scene that throw ArgumentNullExceptions and crash editor when dragged to project view

--

-

How to reproduce:
# Create new project
# Create a cube object in scene
# Make it a prefab by dragging it from hierarchy into project view
# Create a few instances in the scene by dragging prefab from project view into scene
# Delete the prefab in project view
# Create a new cube in the scene, rename it to Cube (exact name as the created prefab in step 2)
# Drag the new cube from hierarchy into project view
# Observe Hierarchy - all prefab instances object names change to Cube
# Ctrl + z to undo these actions
# Observe in hierarchy and scene that ghost objects are left, that show empty inspector and throw exception in console when selected
# Dragging such object into project view crashes the editor

Expected result: No errors thrown/editor doesn't crash

Error:

ArgumentNullException: Value cannot be null.
Parameter name: prefabInstance
UnityEditor.PropertyEditor.ExtractPrefabComponents () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/PropertyEditor.cs:851)
UnityEditor.PropertyEditor.OnTrackerRebuilt () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/PropertyEditor.cs:693)
UnityEditor.PropertyEditor.DrawEditors (UnityEditor.Editor[] editors) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/PropertyEditor.cs:1805)
UnityEditor.PropertyEditor.RebuildContentsContainers () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/PropertyEditor.cs:1010)
UnityEditor.InspectorWindow.OnSelectionChanged () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:144)
UnityEditor.Selection.Internal_CallSelectionChanged () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Selection.cs:37)

 

Reproduced with: 2022.1.0a15, 2022.1.11f1, 2022.2.0b11, 2023.1.0a12

Does not reproduce with: 2021.3.11f1, 2022.1.0a14

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.