aboutsummaryrefslogtreecommitdiff
path: root/src/hid_core/frontend/emulated_controller.cpp
diff options
context:
space:
mode:
authort895 <clombardo169@gmail.com>2024-02-16 21:11:47 -0500
committert895 <clombardo169@gmail.com>2024-02-16 21:11:47 -0500
commit95ea8e955324fb5ed8cd912498c490e683edfcec (patch)
treecd0c0816d125544e0a3605e7720f622611abe6c5 /src/hid_core/frontend/emulated_controller.cpp
parent31b531fb2b645b1e5a890592dc40b82e58028d85 (diff)
hid_core: Prevent crash if we try to iterate through empty color devices list
Diffstat (limited to 'src/hid_core/frontend/emulated_controller.cpp')
-rw-r--r--src/hid_core/frontend/emulated_controller.cpp3
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 b4b6fa7c8d..8b5d0eec6e 100644
--- a/src/hid_core/frontend/emulated_controller.cpp
+++ b/src/hid_core/frontend/emulated_controller.cpp
@@ -581,6 +581,9 @@ void EmulatedController::DisableConfiguration() {
// Get Joycon colors before turning on the controller
for (const auto& color_device : color_devices) {
+ if (color_device == nullptr) {
+ continue;
+ }
color_device->ForceUpdate();
}