Browse Source
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.
pull/15/merge
bunnei
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
0 deletions
-
src/core/hid/emulated_console.cpp
|
|
@ -40,6 +40,11 @@ void EmulatedConsole::SetTouchParams() { |
|
|
touch_params[index++] = std::move(touchscreen_param); |
|
|
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 = |
|
|
const auto button_index = |
|
|
static_cast<u64>(Settings::values.touch_from_button_map_index.GetValue()); |
|
|
static_cast<u64>(Settings::values.touch_from_button_map_index.GetValue()); |
|
|
const auto& touch_buttons = Settings::values.touch_from_button_maps[button_index].buttons; |
|
|
const auto& touch_buttons = Settings::values.touch_from_button_maps[button_index].buttons; |
|
|
|