Преглед изворни кода

HID: Fix crash when pressing a key when the emulator is stopped

Yuri Kunde Schlesner пре 11 година
родитељ
комит
0f69668fc6
1 измењених фајлова са 2 додато и 0 уклоњено
  1. 2 0
      src/core/hle/service/hid/hid.cpp

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

@@ -30,6 +30,8 @@ static s16 next_circle_y = 0;
  * Gets a pointer to the PadData structure inside HID shared memory
  */
 static inline PadData* GetPadData() {
+    if (g_shared_mem == nullptr)
+        return nullptr;
     return reinterpret_cast<PadData*>(g_shared_mem->GetPointer().ValueOr(nullptr));
 }