aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2020-11-25 13:33:01 -0500
committerMorph <39850852+Morph1984@users.noreply.github.com>2020-11-25 13:33:30 -0500
commit9b00708d96fc417591d500f9e8cbef89e5406f0c (patch)
tree9c908f8bc5ec4c963d81260899347be7fef1ece1 /src/core
parentbd0a2db49ad3a2afa41005995a4b316a6ad7ca5f (diff)
hid: Check if applet_resource exists in InitializeVibrationDevice
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/hid/hid.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 902516b29c..db9f5e7011 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -155,8 +155,10 @@ private:
IPC::RequestParser rp{ctx};
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={}",
vibration_device_handle.npad_type, vibration_device_handle.npad_id,