Просмотр исходного кода

hid: Check if applet_resource exists in InitializeVibrationDevice

Morph 5 лет назад
Родитель
Сommit
6f70e1b1ff
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      src/core/hle/service/hid/hid.cpp

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

@@ -155,8 +155,10 @@ private:
         IPC::RequestParser rp{ctx};
         IPC::RequestParser rp{ctx};
         const auto vibration_device_handle{rp.PopRaw<Controller_NPad::DeviceHandle>()};
         const auto vibration_device_handle{rp.PopRaw<Controller_NPad::DeviceHandle>()};
 
 
-        applet_resource->GetController<Controller_NPad>(HidController::NPad)
-            .InitializeVibrationDevice(vibration_device_handle);
+        if (applet_resource != nullptr) {
+            applet_resource->GetController<Controller_NPad>(HidController::NPad)
+                .InitializeVibrationDevice(vibration_device_handle);
+        }
 
 
         LOG_DEBUG(Service_HID, "called, npad_type={}, npad_id={}, device_index={}",
         LOG_DEBUG(Service_HID, "called, npad_type={}, npad_id={}, device_index={}",
                   vibration_device_handle.npad_type, vibration_device_handle.npad_id,
                   vibration_device_handle.npad_type, vibration_device_handle.npad_id,