diff options
| author | bunnei <bunneidev@gmail.com> | 2022-12-30 03:26:41 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-30 03:26:41 -0500 |
| commit | 8497fa6f17efe19506a80d4e4e522e1a71ebcc87 (patch) | |
| tree | 2572337125fdffa34674478b763f28c53a71febf | |
| parent | 90a07c90f07c14509a4a792f40430cf252e0b4bf (diff) | |
| parent | d466f5e2b894715d80bd544a2bee31850fd39605 (diff) | |
Merge pull request #9524 from bunnei/touch-button-crash-fix
core: hid: emulated_console: Avoid a crash if frontend does not configure touch_from_button_maps.
| -rw-r--r-- | src/core/hid/emulated_console.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/hid/emulated_console.cpp b/src/core/hid/emulated_console.cpp index 30c2e9d170..1c91bbe40c 100644 --- a/src/core/hid/emulated_console.cpp +++ b/src/core/hid/emulated_console.cpp @@ -40,6 +40,11 @@ void EmulatedConsole::SetTouchParams() { touch_params[index++] = std::move(touchscreen_param); } + if (Settings::values.touch_from_button_maps.empty()) { + LOG_WARNING(Input, "touch_from_button_maps is unset by frontend config"); + return; + } + const auto button_index = static_cast<u64>(Settings::values.touch_from_button_map_index.GetValue()); const auto& touch_buttons = Settings::values.touch_from_button_maps[button_index].buttons; |
