-
Notifications
You must be signed in to change notification settings - Fork 109
Description
Describe the bug
We are getting production app crash reports here with the toString. Crashlytics is reporting it as:
Encodable.toString(pretty:)
NSInvalidArgumentException - NaN number in JSON write
To Reproduce
So far I don't have a clear repro case. But, we have 34 crash events affecting 30 users.
It looks like some our custom data being added to dictionary payloads has NaN numeric (NSNumber) values. And that is making it through the JSON tests (e.g., here), but later somehow causing the JSONDecoder to crash.
I can't actually show that above idea with an actual crash in our development build though, so that's just my best guess so far.
Expected behavior
I wouldn't expect the JSONDecoder usage in JSON.swift to cause an app crash.
Screenshots
See above.
Platform (please complete the following information):
- Library Version in use: 1.4.7
- Platform being tested: iOS and iPadOS-- most crashes are on iPad, but many of our users are on iPad also.
- Integrations in use: Firebase
Additional context
I'd like to resolve this ASAP. I'm hoping to get a patch into our production app. Thanks.
