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

Create date formatters at initialization time rather than at runtime #807

Merged
merged 2 commits into from
Sep 16, 2020

Conversation

kstenerud
Copy link
Contributor

We had some null pointer exceptions in code that was using BSG_RFC3339DateTool, which seems to be caused by a nil instance of the date formatter. I couldn't find any definitive culprit, but with this change there's zero possibility of the formatter ever being nil again.

Crash: -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[2]

Crashing code: https://github.com/bugsnag/bugsnag-cocoa/blob/v6.1.2/Bugsnag/Delivery/BugsnagSessionTrackingApiClient.m#L74

Potentially problematic code: https://github.com/bugsnag/bugsnag-cocoa/blob/v6.1.2/Bugsnag/Helpers/BSG_RFC3339DateTool.m#L36

Fixes https://bugsnag.atlassian.net/browse/PLAT-5047

We had some null pointer exceptions in code that was using BSG_RFC3339DateTool, which seems to be caused by a nil instance of the date formatter. I couldn't find any definitive culprit, but with this change there's zero possibility of the formatter ever being nil again.
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.

2 participants