From 0f2350308ed977f856bb8593a9bbeba8401c544a Mon Sep 17 00:00:00 2001 From: Nicola Ferruzzi Date: Thu, 8 Aug 2019 00:06:49 -0700 Subject: [PATCH] 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 --- YogaKit/Source/YGLayout.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/YogaKit/Source/YGLayout.m b/YogaKit/Source/YGLayout.m index 35d00b96..4a9ab872 100644 --- a/YogaKit/Source/YGLayout.m +++ b/YogaKit/Source/YGLayout.m @@ -180,7 +180,7 @@ static YGConfigRef globalConfig; // the measure function. Since we already know that this is a leaf, // this *should* be fine. Forgive me Hack Gods. const YGNodeRef node = self.node; - if (YGNodeHasMeasureFunc(node)) { + if (!YGNodeHasMeasureFunc(node)) { YGNodeSetMeasureFunc(node, YGMeasureView); }