Fixed an issue where an invalid UIMode entry in es_settings.xml could lead to a crash.

This commit is contained in:
Leon Styhre 2021-11-06 20:47:30 +01:00
parent cdf0227ad4
commit 46228c6a9d

View file

@ -39,6 +39,12 @@ UIModeController::UIModeController()
{
mPassKeySequence = Settings::getInstance()->getString("UIMode_passkey");
mCurrentUIMode = Settings::getInstance()->getString("UIMode");
// Handle a potentially invalid entry in the configuration file.
if (mCurrentUIMode != "full" && mCurrentUIMode != "kid" && mCurrentUIMode != "kiosk") {
mCurrentUIMode = "full";
Settings::getInstance()->setString("UIMode", mCurrentUIMode);
Settings::getInstance()->saveFile();
}
}
void UIModeController::monitorUIMode()