From b790bf7dbabc39e525d7d6d35975605d885baed2 Mon Sep 17 00:00:00 2001 From: Lukas Woehrl Date: Thu, 5 Jan 2017 20:52:55 +0100 Subject: [PATCH] crash if custom baseline function returns undefined --- yoga/Yoga.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/yoga/Yoga.c b/yoga/Yoga.c index b90ab0af..07cea9d0 100644 --- a/yoga/Yoga.c +++ b/yoga/Yoga.c @@ -958,9 +958,7 @@ static inline YGDirection YGNodeResolveDirection(const YGNodeRef node, static float YGBaseline(const YGNodeRef node) { if (node->baseline != NULL) { const float baseline = node->baseline(node); - if (YGFloatIsUndefined(baseline)) { - return node->layout.measuredDimensions[YGDimensionHeight]; - } + YG_ASSERT(!YGFloatIsUndefined(baseline), "Expect custom baseline function to not return NaN") return baseline; }