diff options
| author | 2024-02-16 21:11:47 -0500 | |
|---|---|---|
| committer | 2024-02-16 21:11:47 -0500 | |
| commit | ac33847b3005dab85bc8e5792188713b973c4b1e (patch) | |
| tree | cd0c0816d125544e0a3605e7720f622611abe6c5 | |
| parent | hid_core: Use dedicated "port" for android's input overlay (diff) | |
| download | yuzu-ac33847b3005dab85bc8e5792188713b973c4b1e.tar.gz yuzu-ac33847b3005dab85bc8e5792188713b973c4b1e.tar.xz yuzu-ac33847b3005dab85bc8e5792188713b973c4b1e.zip | |
hid_core: Prevent crash if we try to iterate through empty color devices list
Diffstat (limited to '')
| -rw-r--r-- | src/hid_core/frontend/emulated_controller.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/hid_core/frontend/emulated_controller.cpp b/src/hid_core/frontend/emulated_controller.cpp index b4b6fa7c8..8b5d0eec6 100644 --- a/src/hid_core/frontend/emulated_controller.cpp +++ b/src/hid_core/frontend/emulated_controller.cpp | |||
| @@ -581,6 +581,9 @@ void EmulatedController::DisableConfiguration() { | |||
| 581 | 581 | ||
| 582 | // Get Joycon colors before turning on the controller | 582 | // Get Joycon colors before turning on the controller |
| 583 | for (const auto& color_device : color_devices) { | 583 | for (const auto& color_device : color_devices) { |
| 584 | if (color_device == nullptr) { | ||
| 585 | continue; | ||
| 586 | } | ||
| 584 | color_device->ForceUpdate(); | 587 | color_device->ForceUpdate(); |
| 585 | } | 588 | } |
| 586 | 589 | ||