Closed uncapped-shattuck closed 1 month ago
Hi @uncapped-shattuck
Thanks for reaching out and highlighting this issue. We do now have an item on our backlog aimed at investigating this issue further when priority allows.
Once we have more information to share we will be sure to follow up and inform you of any updates.
Hi @uncapped-shattuck
We have now implemented a fix for this in the v8.0.0 release of bugsnag-unity
: https://github.com/bugsnag/bugsnag-unity/releases/tag/v8.0.0
Please let us know if you notice any other issues after upgrading to this version.
Describe the bug
There is a race condition between the
BugsnagUnity.Bugsnag.InternalClient
being initialized to a non-null value and attempting to use theInternalClient
indirectly viaTimingTrackingBehaviour.OnApplicationFocus
- the ctor ofBugsnagUnity.Client
initializes the timing tracker, which means that focus changes that happen after the timing tracker starts but before the ctor finishes and the assignment completes will cause a null reference exception.Steps to reproduce
This is a race condition with a very narrow window, so the change of reproducing it is low
Bugsnag.Start()
in Unity to initialize the clientBugsnagUnity.Bugsnag.SetApplicationState
Environment
Error messages:
``` NullReferenceException: Object reference not set to an instance of an object at BugsnagUnity.Bugsnag.SetApplicationState (System.Boolean inFocus) [0x00005] in