Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle null status of client #788

Merged
merged 5 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### TBD

- Added more null reference checking to the Bugsnag client to prevent crashes when accessing the client before it has been initialised [#788](https://github.com/bugsnag/bugsnag-unity/pull/788)

## 7.7.3 (2024-04-11)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion src/BugsnagUnity/Bugsnag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static bool IsStarted()
/// the tracking of in foreground time for the application.
/// </summary>
/// <param name="inFocus"></param>
public static void SetApplicationState(bool inFocus) => Client.SetApplicationState(inFocus);
public static void SetApplicationState(bool inFocus) => Client?.SetApplicationState(inFocus);
clr182 marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>
/// Bugsnag uses the concept of contexts to help display and group your errors.
Expand Down