Search Issue Tracker

Fixed in 2021.2.X

Votes

0

Found in

2018.4

2019.4

2020.1

2020.2

2020.3

2021.1

2021.2

2021.2.0a12

Issue ID

1325826

Regression

No

[Undo] [Improved prefabs] Errors are thrown on performing the 'Undo' operation over the Prefab Override window

Scene Management

-

On applying the 'Undo' function over the Prefab Override window, errors thrown in the console. Refer attached video and StackTrace.

Steps to reproduce:
1. Create a new project
2. Create two empty GameObjects "A" and "B" > Drag drop-in project to make prefabs
3. Make B a child of A.
4. Select A > In Override window select B
5. Press 'Undo' or (Cmd⌘ +Z) until Create/Replace Prefab option comes.

Actual result:
Errors are thrown on applying the 'Undo' function over the Prefab Override window.

Expected result:
No errors in the console and Undo operation should perform gracefully.

Occuring in :
2021.2.0a12, 2021.2.0a1, 2021.1.1f1, 2021.1.0a1, 2020.3.3f1, 2020.2.6f1, 2020.1.17f1, 2019.4.22f, 2018.4.34f1

Environment:
Windows10 and macOS 10.15

Stack Trace:
GeneratePrefabOverrides should only be called with GameObjects that are part of a prefab
UnityEditor.Undo:Internal_CallUndoRedoPerformed () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Undo/Undo.bindings.cs:263)

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.PrefabOverridesWindow.UpdateTextSingle (UnityEngine.GameObject prefabAsset) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Prefabs/PrefabOverrides/PrefabOverridesWindow.cs:464)
UnityEditor.PrefabOverridesWindow.RefreshStatus (System.Boolean reloadTreeView) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Prefabs/PrefabOverrides/PrefabOverridesWindow.cs:122)
UnityEditor.PrefabOverridesWindow.OnUndoRedoPerformed () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Prefabs/PrefabOverrides/PrefabOverridesWindow.cs:110)
UnityEditor.Undo.Internal_CallUndoRedoPerformed () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Undo/Undo.bindings.cs:263)

Note: For 2018.4 getting the following errors

1. SerializedObject target has been destroyed.
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

2. ArgumentNullException: Value cannot be null.
Parameter name: componentOrGameObject
UnityEditor.PrefabUtility.IsAnyPrefabInstanceRoot (UnityEngine.GameObject gameObject) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Prefabs/PrefabUtility.cs:1149)
UnityEditor.PrefabUtility.GetIconForGameObject (UnityEngine.GameObject gameObject) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Prefabs/PrefabUtility.cs:1166)
UnityEditor.GameObjectInspector.DrawInspector () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/GameObjectInspector.cs:256)
UnityEditor.GameObjectInspector.OnHeaderGUI () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/GameObjectInspector.cs:238)
UnityEditor.Editor.DrawHeader () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:683)
UnityEditor.PrefabOverridesTreeView+ComparisonViewPopup.DrawEditor (UnityEngine.Rect rect, UnityEditor.Editor editor, System.Boolean disabled) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Prefabs/PrefabOverrides/PrefabOverridesTreeView.cs:735)
UnityEditor.PrefabOverridesTreeView+ComparisonViewPopup.OnGUI (UnityEngine.Rect rect) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Prefabs/PrefabOverrides/PrefabOverridesTreeView.cs:659)
UnityEditor.PopupWindow.OnGUI () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/PopupWindow.cs:90)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <c8d0d7b9135640958bff528a1e374758>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <c8d0d7b9135640958bff528a1e374758>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <c8d0d7b9135640958bff528a1e374758>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/bokken/buildslave/unity/build/Editor/Mono/HostView.cs:342)
UnityEditor.HostView.Invoke (System.String methodName) (at /Users/bokken/buildslave/unity/build/Editor/Mono/HostView.cs:336)
UnityEditor.HostView.OldOnGUI () (at /Users/bokken/buildslave/unity/build/Editor/Mono/HostView.cs:129)
UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout) (at /Users/bokken/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:244)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

3. GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

  1. Resolution Note (fix version 2021.2):

    An open Comparison View Popup will now be closed if undo operations cause selection changes which affect the content of the Overrides Window's tree view and render the popup's visibility redundant.

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.