Search Unity

Bug (Case #1270132) Null Reference on cancel nested prefab delete

Discussion in 'Prefabs' started by CDF, Aug 13, 2020.

  1. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,311
    This is a strange one. Yesterday I submitted a bug that happens after pressing cancel on the delete nested prefab warning popup; where a NullReference exception would occur from SceneView.OnGUI.

    After getting a response from QA, they were unable to reproduce.
    Today, I'm also unable to reproduce!

    The null reference I got was this:
    Code (CSharp):
    1. NullReferenceException
    2. UnityEditor.SceneView.OnGUI () (at <d1bec46880064709a5e713ad543e6d96>:0)
    3. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <d1bec46880064709a5e713ad543e6d96>:0)
    4. UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <d1bec46880064709a5e713ad543e6d96>:0)
    5. UnityEditor.DockArea.OldOnGUI () (at <d1bec46880064709a5e713ad543e6d96>:0)
    6. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
    7. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
    8. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
    9. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
    10. UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
    11. UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
    12. UnityEngine.UIElements.CommandEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
    13. UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
    14. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
    15. UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
    16. UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
    17. UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
    18. UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
    19. UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
    20. UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
    21. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <2500dd078a544a69b6c923861af6cd15>:0)
    I'm not crazy, this did happen! But today it doesn't.
    I was able to produce this error in an empty project (2020.1.2f1) by doing the following:
    1. Create empty "Level" prefab
    2. Create "Sphere" prefab
    3. Create "Cube" prefab
    4. Make Cube nested inside Sphere
    5. Make Sphere nested inside Level
    6. Try and delete Cube with Level prefab open
    7. Cancel the warning popup and see the null reference.

    The fact this doesn't occur today is really weird, I had it 100% yesterday.
    Could there maybe be something up with my Windows OS that could cause this issue?