bugsnag / bugsnag-unity

Automatic error reporting for Unity games
https://docs.bugsnag.com/platforms/unity
MIT License
89 stars 31 forks source link

`BugsnagUnity.MainThreadDispatchBehaviour.Update()` – `NullReferenceException` #767

Closed gmolk closed 6 months ago

gmolk commented 7 months ago

Hi, hope you're doing well.

We have received around 1.5M all-time events on our BugSnag project from a NullReferenceException error thrown from within BugsnagUnity.MainThreadDispatchBehaviour.Update().

Stacktrace:

UnityEngine.MonoBehaviour.StartCoroutine(System.Collections.IEnumerator routine):0
NullReferenceException
Object reference not set to an instance of an object.

<00000000000000000000000000000000> UnityEngine.MonoBehaviour.StartCoroutine(System.Collections.IEnumerator routine)
<00000000000000000000000000000000> BugsnagUnity.MainThreadDispatchBehaviour.Update()

Our setup on our BugsnagSettingsObject:

Screenshot 2024-01-19 at 10 36 02 AM Screenshot 2024-01-19 at 10 36 05 AM

Environment

The code in question from which the error is being thrown:

public void Update()
    {
      lock (MainThreadDispatchBehaviour._executionQueue)
      {
        while (MainThreadDispatchBehaviour._executionQueue.Count > 0)
          MainThreadDispatchBehaviour._executionQueue.Dequeue()();
      }
    }

I will work on putting together a small reproduction repository as soon as I can. I wanted to open this right away in case this was a known issue though.

Thank you!

clr182 commented 7 months ago

Hi @gmolk,

You seem to be running an older version of the Bugsnag-unity notifier v7.3.0. Our latest version is v7.7.0 and can be downloaded here. Can you please try updating to the latest version and let us know if you are still receiving these errors after upgrading?

mclack commented 6 months ago

Hi @gmolk

As there hasn't been any activity here for a while, we are now closing this issue.

If you continue to experience any problems after upgrading to a newer bugnsag-unity version, please feel free to reopen this issue and include any additional relevant information (such as the aforementioned reproduction repository), or open a ticket with us directly by contacting support@bugsnag.com.