diff options
| author | 2022-12-30 03:26:41 -0500 | |
|---|---|---|
| committer | 2022-12-30 03:26:41 -0500 | |
| commit | 0ac34bd058ad055c5700ad01806b517991e1b87c (patch) | |
| tree | 2572337125fdffa34674478b763f28c53a71febf | |
| parent | Merge pull request #9515 from liamwhite/cmake-refactor (diff) | |
| parent | core: hid: emulated_console: Avoid a crash if frontend does not configure tou... (diff) | |
| download | yuzu-0ac34bd058ad055c5700ad01806b517991e1b87c.tar.gz yuzu-0ac34bd058ad055c5700ad01806b517991e1b87c.tar.xz yuzu-0ac34bd058ad055c5700ad01806b517991e1b87c.zip | |
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 30c2e9d17..1c91bbe40 100644 --- a/src/core/hid/emulated_console.cpp +++ b/src/core/hid/emulated_console.cpp | |||
| @@ -40,6 +40,11 @@ void EmulatedConsole::SetTouchParams() { | |||
| 40 | touch_params[index++] = std::move(touchscreen_param); | 40 | touch_params[index++] = std::move(touchscreen_param); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | if (Settings::values.touch_from_button_maps.empty()) { | ||
| 44 | LOG_WARNING(Input, "touch_from_button_maps is unset by frontend config"); | ||
| 45 | return; | ||
| 46 | } | ||
| 47 | |||
| 43 | const auto button_index = | 48 | const auto button_index = |
| 44 | static_cast<u64>(Settings::values.touch_from_button_map_index.GetValue()); | 49 | static_cast<u64>(Settings::values.touch_from_button_map_index.GetValue()); |
| 45 | const auto& touch_buttons = Settings::values.touch_from_button_maps[button_index].buttons; | 50 | const auto& touch_buttons = Settings::values.touch_from_button_maps[button_index].buttons; |