Explorar o código

hid_core: Prevent crash if we try to iterate through empty color devices list

t895 %!s(int64=2) %!d(string=hai) anos
pai
achega
ac33847b30
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      src/hid_core/frontend/emulated_controller.cpp

+ 3 - 0
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();
     }