ChartsOrg / Charts

Beautiful charts for iOS/tvOS/OSX! The Apple side of the crossplatform MPAndroidChart.
Apache License 2.0
27.62k stars 6k forks source link

Charts/issues/5197 - fixed host app crash by adding a check before ca… #5198

Open sorinmiroiu97 opened 2 months ago

sorinmiroiu97 commented 2 months ago

Issue Link :link:

Link to issue: https://github.com/ChartsOrg/Charts/issues/5197

Goals :soccer:

Fix the crash of the host app from within the library code whenever you get in a situation where the CGFloat calculated in the renderers' isDrawingValuesAllowed function are equal to CGFloat.infinity or to CGFloat.nan, as type casting those causes a crash.

Implementation Details :construction:

Honestly it's pretty self explanatory and it's rather a dumb-value check, nothing crazy or complicated. The issue explains it all already.

Testing Details :mag:

I didn't add any tests, as there's no point in testing something that i added because if fails at the compiler level so i don't think any tests are required, but please let me know.

sorinmiroiu97 commented 2 weeks ago

@Naveen-C-Ramachandrappa thanks for the approval. Do you know when we can expect the PR to be merged in? Thanks a lot 😄