title: NullReferenceExceptionwhen using Unity UIBuilder drop down menu
body: <p>I keep getting the following error :
  &quot;NullReferenceException: Object reference not set to an instance of an object&quot;</p>
  <p>I have copied the example code almost exactly and yet seems to keep getting this error when trying to change the choice list, here is my code for this element (sorry I'm new to unity ui):</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using UnityEngine;
  using UnityEngine.UIElements;
  using UnityEngine.SceneManagement;
  using UnityEngine.Audio;
  
  public class SettingsMenuController : MonoBehaviour
  {
      public DropdownField ResolutionSelect;
  
      [SerializeField] public List&lt;string&gt; Resolutions = new List&lt;string&gt; {&quot;Option1&quot;,&quot;Option2&quot;,&quot;Option45&quot;};
  
      // Start is called before the first frame update. 
      void Start()
      {
          var root = GetComponent&lt;UIDocument&gt;().rootVisualElement;
  
          ResolutionSelect = root.Q&lt;DropdownField&gt;(&quot;ResolutionSelect&quot;);
  
          ResolutionSelect.choices = new List&lt;string&gt; {&quot;option1&quot;};
          ResolutionSelect.value = Resolutions[0];
      }
  }
  </code></pre>
  <p>the error occurs on the line &quot;ResolutionSelect.choices = new List {&quot;option1&quot;};&quot;.</p>
  <p>I'm trying to make a dropdown menu to change the resolution but its proving difficult, any help or advise is appreciated and thank you in advance.</p>