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

Conversation

clr182
Copy link
Contributor

@clr182 clr182 commented Apr 11, 2024

Goal

The client should not be null at this point.

Design

I've added an elvis operator to set application state of the client if it isn't null. I think that this might work to some degree, but it doesn't really handle the race condition.
Might be better to add a less performative try/catch block instead. or check the client again to see whether it is null and return a log error.

Changeset

Added null checking operator. to SetApplicationState of client.

Testing

Manually

The client should not be null at this point. I've added an elvis operator to set application state of the client if it isn't null. I think that this might work to some degree, but it doesn't really handle the race condition. Might be better to add a less performative try/catch block instead. or check the client again to see whether it is null and return a log error.
@clr182 clr182 self-assigned this Apr 11, 2024
@clr182 clr182 requested a review from richardelms April 11, 2024 13:39
@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Apr 11, 2024

Build size impact

Format Size impact of Bugsnag (kB)
IL2CPP APK 2438.67
IL2CPP IPA 1497.97

Generated by 🚫 Danger

src/BugsnagUnity/Bugsnag.cs Outdated Show resolved Hide resolved
clr182 and others added 2 commits May 3, 2024 23:28
@clr182 clr182 requested a review from richardelms May 7, 2024 08:09
@richardelms richardelms merged commit 1f70a41 into next May 31, 2024
3 of 5 checks passed
@richardelms richardelms deleted the PLAT-11914-InternalClientNullRefFix branch May 31, 2024 06:14
@richardelms richardelms mentioned this pull request Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants