[poincare] Fixed crash due to infinite loop with horizontal layout

Change-Id: I00106525b29ce441e10a6d88766efdecd80d8291
This commit is contained in:
Hugo Saint-Vignes
2020-08-11 11:26:48 +02:00
committed by Émilie Feral
parent 74a2211a6a
commit f562886a7e

View File

@@ -266,7 +266,10 @@ IntegralLayoutNode * IntegralLayoutNode::previousNestedIntegral() {
}
if (p->numberOfChildren() == 1 && prev->type() == Type::IntegralLayout) {
// We can consider the integrals in a row only if the horizontal layout just contains an integral
return static_cast<IntegralLayoutNode *>(prev);
// The horizontal layout must be the previous integral's integrand
if (prev->childAtIndex(0) == p) {
return static_cast<IntegralLayoutNode *>(prev);
}
}
}
return nullptr;