From e24de79a9e8f4cf8c422f3bca4c3d3bc28dc1f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 28 May 2020 17:29:15 +0200 Subject: [PATCH] [apps/calculation] HistoryController: avoid dereferencing nullptr --- apps/calculation/history_controller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/calculation/history_controller.cpp b/apps/calculation/history_controller.cpp index 6e437fce0..a9bbc1e1e 100644 --- a/apps/calculation/history_controller.cpp +++ b/apps/calculation/history_controller.cpp @@ -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);