Skip to content

Commit

Permalink
Fix fromRawValue(EdgeInsets) from single float case falling through t…
Browse files Browse the repository at this point in the history
…o float array

Summary:
If `value` is of type `float`, it will still fall through to the `react_native_assert` below, exploding. The `map` type is handled correctly.

Changelog: [Internal][Fixed] Fix fromRawValue(EdgeInsets) from single float case falling through to float array and exploding

Reviewed By: javache

Differential Revision: D32648848

fbshipit-source-id: e70cddd291a8f52d6ee3de5fef11b0bb7aee92cd
  • Loading branch information
Guad authored and facebook-github-bot committed Nov 30, 2021
1 parent a4a3e67 commit 79d20a1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ReactCommon/react/renderer/graphics/conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ inline void fromRawValue(
if (value.hasType<Float>()) {
auto number = (Float)value;
result = {number, number, number, number};
return;
}

if (value.hasType<better::map<std::string, Float>>()) {
Expand Down

0 comments on commit 79d20a1

Please sign in to comment.