Commit 8067f7b
Fix TypeError when serializing arbitrary transform operation (#55445)
Summary:
Pull Request resolved: #55445
The `TransformOperationType::Arbitrary` case was incorrectly using the `[]` operator with a string key on a `folly::dynamic` array (`resultTranslateArray`). This throws a `TypeError` at runtime because `folly::dynamic` arrays only support numeric index access - string key access is only valid for objects.
The fix creates a `folly::dynamic::object()`, sets the "matrix" key on it, and then pushes the object to the array using `push_back()`. This follows the same pattern already used by `serializeTransformOperationValue()` and other serialization helpers in this file.
## Changelog:
[General][Fixed] - fixed TypeError when serializing arbitrary transform operation
Reviewed By: cortinico
Differential Revision: D92499621
fbshipit-source-id: d91522f0534c5429f27ad2ce423e65ddb17893201 parent 08d1764 commit 8067f7b
1 file changed
Lines changed: 3 additions & 2 deletions
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
0 commit comments