mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Sanitize float value before calling setCameraDistance
Summary: Fixes the crash when calling setCameraDistance with NaN on Android Q. Reviewed By: JoshuaGross, mdvacca Differential Revision: D17170045 fbshipit-source-id: 386f969e70c56bca6ae5b8ffead62453ebb72857
This commit is contained in:
committed by
Facebook Github Bot
parent
bf01dfbc97
commit
d69387dac8
@@ -324,7 +324,8 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
|
||||
// sqrt(5) produces an exact replica with iOS.
|
||||
// For more information, see https://github.com/facebook/react-native/pull/18302
|
||||
float normalizedCameraDistance =
|
||||
scale * scale * cameraDistance * CAMERA_DISTANCE_NORMALIZATION_MULTIPLIER;
|
||||
sanitizeFloatPropertyValue(
|
||||
scale * scale * cameraDistance * CAMERA_DISTANCE_NORMALIZATION_MULTIPLIER);
|
||||
view.setCameraDistance(normalizedCameraDistance);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user