Properly test for the lack of a node measure func in YogaKit (#915)

Summary:
The test was broken and caused a few crashes on my project.
Pull Request resolved: https://github.com/facebook/yoga/pull/915

Differential Revision: D16701613

Pulled By: davidaurelio

fbshipit-source-id: 9ab5c43bb74e77593bc2426a249750a7ee8f4034
This commit is contained in:
Nicola Ferruzzi
2019-08-08 00:06:49 -07:00
committed by Facebook Github Bot
parent 9b120eded9
commit 0f2350308e

View File

@@ -180,7 +180,7 @@ static YGConfigRef globalConfig;
// the measure function. Since we already know that this is a leaf, // the measure function. Since we already know that this is a leaf,
// this *should* be fine. Forgive me Hack Gods. // this *should* be fine. Forgive me Hack Gods.
const YGNodeRef node = self.node; const YGNodeRef node = self.node;
if (YGNodeHasMeasureFunc(node)) { if (!YGNodeHasMeasureFunc(node)) {
YGNodeSetMeasureFunc(node, YGMeasureView); YGNodeSetMeasureFunc(node, YGMeasureView);
} }