Enum field gets NullPointerException at UnityEditor.EditorGUI.DoTextField in inspector

I created enum and set SerializeField to this field like this.

using UnityEngine;

public class Test : MonoBehaviour
{
    [SerializeField] private TestEnum _segmentCode;
    // Start is called before the first frame update
    void Start()
    {
       
    }

    // Update is called once per frame
    void Update()
    {
       
    }
}

public enum TestEnum
{
    A, B, C
}

I can see TestEnum field in inspector.

But can not change this value and get error below.

Unity version 2021.3.29f1

What happens??How can I fix it??

I can give additional information.
I created new project and I tried same thing.
It works.

So, this error on only my project…
but I can’t find what caused from.

Well the error is coming from Odin Inspector.

It was caused by Unity changing the name of a few GUIStyles, which broke a lot of editor tools.

Solution is to just update Odin.

Ah, I missed that!
Thank you! I’ll try update!

Fyi this has been fixed for Unity 6 in the new Odin release 3.3.1 (May 14th, 2024).