Repository navigation
Commit 8c86da6
authored
Guard C++ TransformAnimatedNode against static transforms without a numeric value
Summary:
`TransformAnimatedNode::collectViewUpdates` read a static transform's value with a const `folly::dynamic` `operator[]` followed by `asDouble()`. When a JS transform entry is `undefined` (e.g. `transform: [{translateX: anim}, {scale: undefined}]`), `AnimatedTransform.__getNativeConfig` emits `{type: 'static', property, value: undefined}`, and the JSI-to-dynamic conversion drops undefined properties, so the `value` key is missing. The lookup throws `std::out_of_range`, which escapes the `noexcept` `NativeAnimatedNodesManager::connectAnimatedNodeToView` / `updateNodes` callers and calls `std::terminate`. A `null` or non-numeric value threw `folly::TypeError` the same way.
Skip static entries whose value is missing or not a number, as already happens when an animated entry's input node is absent.
Changelog:
[General][Fixed] - Fix crash in the C++ native animated backend when a transform with a native-driven value also contains an `undefined` or non-numeric static entry
Differential Revision: D132012881
Pull Request resolved: #600931 parent 13b3b85 commit 8c86da6
2 files changed
Lines changed: 57 additions & 2 deletions
File tree
- packages/react-native/ReactCommon/react/renderer/animated
- nodes
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
416 | 468 | | |
417 | 469 | | |
418 | 470 | | |
| |||
0 commit comments