Explorar o código

hid.cpp: Fixed crash when updating pad data while null

Fixes #137
archshift %!s(int64=11) %!d(string=hai) anos
pai
achega
366ae1b351
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/core/hle/service/hid.cpp

+ 4 - 0
src/core/hle/service/hid.cpp

@@ -78,6 +78,10 @@ void PadButtonRelease(PadState pad_state) {
 void PadUpdateComplete() {
     PadData* pad_data = GetPadData();
 
+    if (pad_data == nullptr) {
+        return;
+    }
+
     // Update PadData struct
     pad_data->current_state.hex = next_state.hex;
     pad_data->index = next_index;