mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Use default value instead of abort when parsing color
Summary: changelog: [internal] Fabric is missing implementation of PlatformColor APIs. If it is used, it causes a crash. Until it is implemented, let's remove abort statement and continue with transparent color. Reviewed By: mdvacca Differential Revision: D27395917 fbshipit-source-id: 50d541c5cacc10a7652f7f1ddc97e086a4ba8f03
This commit is contained in:
committed by
Facebook GitHub Bot
parent
79090c4802
commit
3b8fbc336c
@@ -20,10 +20,10 @@ namespace react {
|
||||
#pragma mark - Color
|
||||
|
||||
inline void fromRawValue(const RawValue &value, SharedColor &result) {
|
||||
float red;
|
||||
float green;
|
||||
float blue;
|
||||
float alpha;
|
||||
float red = 0;
|
||||
float green = 0;
|
||||
float blue = 0;
|
||||
float alpha = 0;
|
||||
|
||||
if (value.hasType<int>()) {
|
||||
auto argb = (int64_t)value;
|
||||
@@ -40,9 +40,8 @@ inline void fromRawValue(const RawValue &value, SharedColor &result) {
|
||||
green = items.at(1);
|
||||
blue = items.at(2);
|
||||
alpha = length == 4 ? items.at(3) : 1.0f;
|
||||
} else {
|
||||
abort();
|
||||
}
|
||||
|
||||
result = colorFromComponents({red, green, blue, alpha});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user