From 2ec4bc29e03e12ac010f8772b64b22c872f98dc7 Mon Sep 17 00:00:00 2001 From: Adrien Bertrand Date: Sun, 3 Nov 2019 18:50:12 +0100 Subject: [PATCH] [apps] [code] Fix nullptr deref (fix #1176) When scrolling up in the python shell history, `selectedCell` could be NULL. --- apps/code/console_controller.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/code/console_controller.cpp b/apps/code/console_controller.cpp index 0a1c41586..1041630f9 100644 --- a/apps/code/console_controller.cpp +++ b/apps/code/console_controller.cpp @@ -267,7 +267,9 @@ void ConsoleController::tableViewDidChangeSelection(SelectableTableView * t, int } } ConsoleLineCell * selectedCell = (ConsoleLineCell *)(t->selectedCell()); - selectedCell->reloadCell(); + if (selectedCell) { + selectedCell->reloadCell(); + } } }