From 9be5e7671c9da1dc45fa52df277607297bea0ffd Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Thu, 27 Aug 2020 11:20:14 +0200 Subject: [PATCH] [apps/settings] Fix broken assert Pressing OK or EXE with the brightness setting selected would cause a crash because of a mishandling of the events for this cell. Change-Id: I4978b4f749b5f19bc1e49ec05b60a32044d86638 --- apps/settings/main_controller.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/settings/main_controller.cpp b/apps/settings/main_controller.cpp index d12cb186b..2c6b80698 100644 --- a/apps/settings/main_controller.cpp +++ b/apps/settings/main_controller.cpp @@ -65,7 +65,11 @@ bool MainController::handleEvent(Ion::Events::Event event) { } if (event == Ion::Events::OK || event == Ion::Events::EXE || event == Ion::Events::Right) { - assert(rowIndex != k_indexOfBrightnessCell); + if (rowIndex == k_indexOfBrightnessCell) { + /* Nothing is supposed to happen when OK or EXE are pressed on the + * brightness cell. The case of pressing Right has been handled above. */ + return true; + } if (rowIndex == k_indexOfLanguageCell) { m_localizationController.setMode(LocalizationController::Mode::Language);