Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Bug 2023.1.5f1 NullReferenceException: SerializedObject of SerializedProperty has been Disposed.

Discussion in 'Editor & General Support' started by Kas_, Jul 20, 2023.

  1. Kas_

    Kas_

    Joined:
    Dec 27, 2017
    Posts:
    72
    Still getting error NullReferenceException: SerializedObject of SerializedProperty has been Disposed.

    This issue occurs when inspecting an object in the scene Heirarchy that has a script attached with an array list ( need to expand array list in inspector ). This issue has been going on for a few versions and hasnt been fixed. Very annoying issue.. You will get thousands of these errors until you deselect the Heirarchy object with script that has the array list.

    Edit: This issue can also happen sometimes with objects that dont have an array list

    NullReferenceException: SerializedObject of SerializedProperty has been Disposed.
    UnityEditor.SerializedProperty.get_objectReferenceInstanceIDValue () (at <8bcfff76472c48f096bf077900dc8a3a>:0)
    UnityEditor.EditorGUIUtility.ObjectContent (UnityEngine.Object obj, System.Type type, UnityEditor.SerializedProperty property, UnityEditor.EditorGUI+ObjectFieldValidator validator) (at <8bcfff76472c48f096bf077900dc8a3a>:0)
    UnityEditor.UIElements.ObjectField+ObjectFieldDisplay.Update () (at <8bcfff76472c48f096bf077900dc8a3a>:0)
    UnityEditor.UIElements.ObjectField.UpdateDisplay () (at <8bcfff76472c48f096bf077900dc8a3a>:0)
    UnityEngine.UIElements.VisualElement+SimpleScheduledItem.PerformTimerUpdate (UnityEngine.UIElements.TimerState state) (at <efdbd554e9224c1a9356b48e03e9227b>:0)
    UnityEngine.UIElements.TimerEventScheduler.UpdateScheduledEvents () (at <efdbd554e9224c1a9356b48e03e9227b>:0)
    UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.UpdateSchedulers () (at <efdbd554e9224c1a9356b48e03e9227b>:0)
    UnityEngine.UIElements.UIEventRegistration.UpdateSchedulers () (at <efdbd554e9224c1a9356b48e03e9227b>:0)
    UnityEditor.RetainedMode.UpdateSchedulers () (at <c17f764e537e4504996a1276b92c2323>:0)
     
    Last edited: Jul 20, 2023
  2. zero-fill

    zero-fill

    Joined:
    Feb 28, 2020
    Posts:
    5
    CareyMcDuff and Kas_ like this.
  3. Kas_

    Kas_

    Joined:
    Dec 27, 2017
    Posts:
    72
    At least im not the only one
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,445
    There's been thousands of threads with this same UIElements error.

    It feels like UIElements isn't really ready for "Prime time" yet.

    Even the docs admit this: https://docs.unity3d.com/Manual/UIToolkits.html

    "Unity intends for UI Toolkit to become the recommended UI system for new UI development projects, but it is still missing some features found in Unity UI (uGUI) and IMGUI."

    It appears one of those "missing features" might be the "NOT falling over itself with null reference errors" feature. :)

    It's unfortunate because UnityEngine.UI works so well and has worked so well for ten years now, and yet we're abandoning it all and it has now become Legacy, with nothing truly ready to replace it, alas.
     
  5. zero-fill

    zero-fill

    Joined:
    Feb 28, 2020
    Posts:
    5
    CareyMcDuff likes this.