Button destroy self on click, EventSystem throws MissingReferenceException

Hi,

I have a button and when my character is taking damage I’m deleting it the following way:

public void TryGiveBurger()
{
    // Update health

    if (_health <= 0f)
    {
        OnDeath();
    }
}

protected override void OnDeath()
{
    CustomerManager.Instance.UnregisterCustomer(gameObject);
    Destroy(gameObject);
}

However when I do that I get this error:

MissingReferenceException: The object of type 'UnityEngine.GameObject' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Object+MarshalledUnityObject.TryThrowEditorNullExceptionObject (UnityEngine.Object unityObj, System.String parameterName) (at <adbae017f0374fce9921b97a33a4e8ca>:0)
UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException (System.Object obj) (at <adbae017f0374fce9921b97a33a4e8ca>:0)
UnityEngine.GameObject.get_transform () (at <adbae017f0374fce9921b97a33a4e8ca>:0)
UnityEngine.InputSystem.UI.InputSystemUIInputModule.ProcessPointerMovement (UnityEngine.InputSystem.UI.ExtendedPointerEventData eventData, UnityEngine.GameObject currentPointerTarget) (at ./Library/PackageCache/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs:476)
UnityEngine.InputSystem.UI.InputSystemUIInputModule.ProcessPointerMovement (UnityEngine.InputSystem.UI.PointerModel& pointer, UnityEngine.InputSystem.UI.ExtendedPointerEventData eventData) (at ./Library/PackageCache/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs:402)
UnityEngine.InputSystem.UI.InputSystemUIInputModule.ProcessPointer (UnityEngine.InputSystem.UI.PointerModel& state) (at ./Library/PackageCache/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs:352)
UnityEngine.InputSystem.UI.InputSystemUIInputModule.Process () (at ./Library/PackageCache/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs:2257)
UnityEngine.EventSystems.EventSystem.Update () (at ./Library/PackageCache/com.unity.ugui/Runtime/UGUI/EventSystem/EventSystem.cs:530)

My main issue is that the error doesn’t seem to arise from my code but from Unity EventSystem, and it keep throwing in loop until I replace my object with a new one
Do I need to call some method or delete my button another way to avoid this?

Thanks in advance,

If someone else get that problem, I solved it by disable raycast target

protected override void OnDeath()
{
    CustomerManager.Instance.UnregisterCustomer(gameObject);
    GetComponent<Image>().raycastTarget = false;
    StartCoroutine(Delete());
}

private IEnumerator Delete()
{
    yield return new WaitForEndOfFrame();
    Destroy(gameObject);
}