Assertion Error on Destroying a PlayerInput or Unpairing a Device from It

Hi,

I want to destroy the gameobject which has a PlayerInput when the device paired to it gets disconnected; However calling Destroy on the object leads to an Assertion error as follows:

UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr)

I get the same assertion error when I try to unpair the disconnected device using:

playerInput.user.UnpairDevice(playerInput.devices.First());

Look forward to hearing from you.

Regards,
Aydin

I won’t get any errors when I destroy the GameObject the PlayerInput is attached to; Destroying the GameObject works for me but I don’t think receiving assertion errors for Destroying PlayerInput component be reasonable anyway.