Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Commit

Permalink
fix issue with infinite number preventing serialization
Browse files Browse the repository at this point in the history
Summary:
NSNumber can have teh concept of infinite which cannot be serialized.

somewhere in  story creation flow issue an attribute is the special inifite constant which causes this problem

https://fb.workplace.com/groups/flippersupport/permalink/1961758467638135/

Reviewed By: antonk52

Differential Revision: D65604395

fbshipit-source-id: 5b61c3b6355ee34e24b42829adb07b33ac2127b8
  • Loading branch information
Luke De Feo authored and facebook-github-bot committed Nov 8, 2024
1 parent b070d3f commit a4690bd
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

static auto CGFloatToNSNumber(CGFloat x) -> NSNumber* {
#if CGFLOAT_IS_DOUBLE
return [NSNumber numberWithDouble:x];
return std::isinf(x) ? @(-1) : [NSNumber numberWithDouble:x];
#else
return [NSNumber numberWithFloat:x];
return std::isinf(x) ? @(-1) : [NSNumber numberWithDouble:x];
#endif
}

Expand Down

0 comments on commit a4690bd

Please sign in to comment.