Skip to content

Commit 1519baa

Browse files
NickGerlemanfacebook-github-bot
authored andcommitted
Add config null-check as remediation
Summary: See code comment. D42282358 (facebook@07729ae) 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
1 parent 7f2e681 commit 1519baa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/yoga/src/main/cpp/yoga/Yoga.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -4301,6 +4301,14 @@ YOGA_EXPORT void YGConfigSetExperimentalFeatureEnabled(
43014301
YOGA_EXPORT bool YGConfigIsExperimentalFeatureEnabled(
43024302
const YGConfigRef config,
43034303
const YGExperimentalFeature feature) {
4304+
// S323291 + T145030974 + T145292944: Node config should never be null, but
4305+
// Yoga has a private API used by RN to set config which does not check, and
4306+
// we crash here where config is null. Add a null check as temporary
4307+
// remediation
4308+
if (config == nullptr) {
4309+
return false;
4310+
}
4311+
43044312
return config->experimentalFeatures[feature];
43054313
}
43064314

0 commit comments

Comments
 (0)