[poincare] Fix Matrix copy bug.

When selecting a matrix in the calculation history and pressing 'OK',
in the apps Calculation, there was a nullptr bug.

Change-Id: I8f05771b76bcb3c68b51cf8ca33a49011144abf9
This commit is contained in:
Léa Saviot
2018-01-31 10:32:07 +01:00
parent 214e490112
commit 90068b5cc7

View File

@@ -199,7 +199,7 @@ void ScrollableExpressionViewWithCursor::insertLayoutAtCursor(Poincare::Expressi
return;
}
KDSize previousSize = minimalSizeForOptimalDisplay();
if (layout->isMatrix() && pointedLayout->hasAncestor(layout)) {
if (layout->isMatrix() && pointedLayout && pointedLayout->hasAncestor(layout)) {
static_cast<Poincare::MatrixLayout *>(layout)->addGreySquares();
}
if (pointedLayout != nullptr) {