[apps] [code] Fix nullptr deref (fix #1176)

When scrolling up in the python shell history, `selectedCell` could be NULL.
This commit is contained in:
Adrien Bertrand
2019-11-03 18:50:12 +01:00
committed by EmilieNumworks
parent 4b9e42d522
commit 2ec4bc29e0

View File

@@ -267,7 +267,9 @@ void ConsoleController::tableViewDidChangeSelection(SelectableTableView * t, int
}
}
ConsoleLineCell * selectedCell = (ConsoleLineCell *)(t->selectedCell());
selectedCell->reloadCell();
if (selectedCell) {
selectedCell->reloadCell();
}
}
}