You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix "folly::toJson: JSON object value was an INF" (#6773)
## Summary
This PR fixes the following error (or crash in release mode) on Android:
```
folly::toJson: JSON object value was an INF when serializing value at "..."
```
<img width="443" alt="Screenshot 2024-11-28 at 14 56 22"
src="https://github.com/user-attachments/assets/c6c70e8f-a214-43b6-9e6e-848ee801fab7">
---
Haven't seen this one in a while as this was previously fixed in
#2901
but it looks like now even `catch (std::exception &e)` is not enough so
we need to try with `catch (...)`. Probably symbol linking is broken
somewhere again.
Stack trace:
```
Fatal Exception: java.lang.RuntimeException: folly::toJson: JSON object value was an INF when serializing value at "progress"
at com.facebook.react.bridge.NativeMap.toString(NativeMap.kt)
at com.swmansion.reanimated.nativeProxy.EventHandler.receiveEvent(EventHandler.java)
at com.swmansion.reanimated.nativeProxy.EventHandler.receiveEvent(EventHandler.java:25)
at com.facebook.react.uimanager.events.Event.dispatch(Event.java:173)
at com.swmansion.reanimated.NodesManager.handleEvent(NodesManager.java:350)
at com.swmansion.reanimated.NodesManager.onEventDispatch(NodesManager.java:336)
...
```
## Test plan
Add the following lines in `NodesManager.java` in `onAnimationFrame`:
```cpp
WritableMap writableMap = Arguments.createMap();
writableMap.putDouble("foo", POSITIVE_INFINITY);
handleEvent(9999, "aaa", writableMap);
```
0 commit comments