mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add config null-check as remediation
Summary: See code comment. D42282358 (https://github.com/facebook/react-native/commit/e55277c3310d8f6b712a57f80589cfe91ed35553) added usage of `YGConfigIsExperimentalFeatureEnabled` during layout, in a place where we sometimes encounter a Yoga node from RN which has an unexpectedly null config. This is a hack to stop the bleed while we add logging to figure out where the null config is coming from in RN. Changelog: [Internal] Reviewed By: rozele Differential Revision: D43203521 fbshipit-source-id: 2a21143a45c712ca00d16172f734fb116d165926
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9707378efc
commit
b6b982f563
@@ -4301,6 +4301,14 @@ YOGA_EXPORT void YGConfigSetExperimentalFeatureEnabled(
|
||||
YOGA_EXPORT bool YGConfigIsExperimentalFeatureEnabled(
|
||||
const YGConfigRef config,
|
||||
const YGExperimentalFeature feature) {
|
||||
// S323291 + T145030974 + T145292944: Node config should never be null, but
|
||||
// Yoga has a private API used by RN to set config which does not check, and
|
||||
// we crash here where config is null. Add a null check as temporary
|
||||
// remediation
|
||||
if (config == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return config->experimentalFeatures[feature];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user