[apps/calculation] HistoryController: avoid dereferencing nullptr

This commit is contained in:
Émilie Feral
2020-05-28 17:29:15 +02:00
parent 66ba985108
commit e24de79a9e

View File

@@ -162,7 +162,7 @@ void HistoryController::tableViewDidChangeSelection(SelectableTableView * t, int
} else {
HistoryViewCell * selectedCell = (HistoryViewCell *)(t->selectedCell());
SubviewType nextSelectedSubviewType = selectedSubviewType();
if (!selectedCell->displaysSingleLine()) {
if (selectedCell && !selectedCell->displaysSingleLine()) {
nextSelectedSubviewType = previousSelectedCellY < selectedRow() ? SubviewType::Input : SubviewType::Output;
}
setSelectedSubviewType(nextSelectedSubviewType, false, previousSelectedCellX, previousSelectedCellY);