Thank you for submitting your inquiry.
You can track the status of your inquiry here.
You may want to save your case's ticket: 1061966_m7oap09fs4irruag

    (Closed) EditorGUIUtility.GetObjectPickerControlID() throws a uncatchable UnityException
    EditorGUIUtility.GetObjectPickerControlID() throws a uncatchable UnityException

    1. What happened
    In a custom Inspector (Editor), calling EditorGUIUtility.GetObjectPickerControlID() and EditorGUIUtility.GetObjectPickerObject() will throw a UnityException.

    UnityException: set_type is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'ObjectSelector'.
    See "Script Serialization" page in the Unity Manual for further details.
    UnityEngine.Event.KeyboardEvent (System.String key) (at C:/buildslave/unity/build/Modules/IMGUI/Event.cs:153)
    UnityEditor.ObjectSelector..cctor () (at C:/buildslave/unity/build/Editor/Mono/ObjectSelector.cs:78)
    Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.ObjectSelector' threw an exception.
    UnityEditor.EditorGUIUtility.GetObjectPickerControlID () (at C:/buildslave/unity/build/Editor/Mono/EditorGUIUtility.cs:1426)
    TestInspector.OnInspectorGUI () (at Assets/Scripts/Inspector/TestInspector.cs:23)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, System.Int32 editorIndex, System.Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1374)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

    2. How we can reproduce it using the example you attached
    Click on the Test gameobject in the scene

    License type: Pro
      To follow up on this case, send email to mentioning 'Case 1061966' in the subject.
      Your Cases:
      Case Title Status Date Opened
      1061966 EditorGUIUtility.GetObjectPickerControlID() throws a uncatchable UnityException Closed 7/19/2018 2:10 AM
      1012237 (UWP) DownloadHandlerX GetContent methods throw InvalidOperation exception on device Closed 3/10/2018 8:10 PM