Argument Null Exception when using Serialized Objects

Hello! I have been getting this persistent exception when working with serialized objects in the inspector. I have done sufficient debugging and null checks to nail it down to how the unity editor handles the inspector (onGUI and such), but I don’t really understand why the exception occurs/how to go about fixing it. Here is the code:

Serialized object class:

[System.Serializable]
public class QObj{

public string myStr;

}

Monobehaviour:

public class QBehaviour: MonoBehaviour
{

public QObj[] objArr;

}

and here is the exception trace:


ArgumentNullException: Value cannot be null.

Parameter name: _unity_self

UnityEditor.UIElements.Bindings.SerializedObjectList.get_Count () (at <8ad9ecbe25e14b10b6dde783af6e4aa2>:0)

UnityEditor.UIElements.Bindings.EditorListViewController.GetItemsCount () (at <8ad9ecbe25e14b10b6dde783af6e4aa2>:0)

UnityEngine.UIElements.VerticalVirtualizationController`1[T].get_firstVisibleIndex () (at <e66f217a64a747d48b478f0d70978704>:0)

UnityEngine.UIElements.DynamicHeightVirtualizationController`1[T].Fill () (at <e66f217a64a747d48b478f0d70978704>:0)

UnityEngine.UIElements.VisualElement+SimpleScheduledItem.PerformTimerUpdate (UnityEngine.UIElements.TimerState state) (at <e66f217a64a747d48b478f0d70978704>:0)

UnityEngine.UIElements.TimerEventScheduler.UpdateScheduledEvents () (at <e66f217a64a747d48b478f0d70978704>:0)

UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.UpdateSchedulers () (at <e66f217a64a747d48b478f0d70978704>:0)

UnityEngine.UIElements.UIEventRegistration.UpdateSchedulers () (at <e66f217a64a747d48b478f0d70978704>:0)

UnityEditor.RetainedMode.UpdateSchedulers () (at <8ad9ecbe25e14b10b6dde783af6e4aa2>:0)

For me at least, the error will only begin happening if I change the size of the objArr to nonzero, then run the program. The error will then repeat itself seemingly every frame, even after the run is stopped. It is only after you recompile the monobehaviour that the exception stops being raised. Any insight is appreciated!!!