summaryrefslogtreecommitdiff
path: root/src/hid_core/resources/npad
diff options
context:
space:
mode:
authorGravatar german772024-02-05 16:59:13 -0600
committerGravatar german772024-02-05 17:17:21 -0600
commit372897aac42192bb0290e7ac74e1ae8d15f53a55 (patch)
tree7cbd5f742c67fcfadd6d34ae807d940d178c1da2 /src/hid_core/resources/npad
parentMerge pull request #12905 from liamwhite/hwc-release (diff)
downloadyuzu-372897aac42192bb0290e7ac74e1ae8d15f53a55.tar.gz
yuzu-372897aac42192bb0290e7ac74e1ae8d15f53a55.tar.xz
yuzu-372897aac42192bb0290e7ac74e1ae8d15f53a55.zip
service: hid: Ensure aruid data is initialized
Diffstat (limited to 'src/hid_core/resources/npad')
-rw-r--r--src/hid_core/resources/npad/npad.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hid_core/resources/npad/npad.cpp b/src/hid_core/resources/npad/npad.cpp
index fe3fdc5cd..053625b55 100644
--- a/src/hid_core/resources/npad/npad.cpp
+++ b/src/hid_core/resources/npad/npad.cpp
@@ -131,7 +131,7 @@ void NPad::ControllerUpdate(Core::HID::ControllerTriggerType type, std::size_t c
131 131
132 auto* data = applet_resource_holder.applet_resource->GetAruidDataByIndex(aruid_index); 132 auto* data = applet_resource_holder.applet_resource->GetAruidDataByIndex(aruid_index);
133 133
134 if (!data->flag.is_assigned) { 134 if (data == nullptr || !data->flag.is_assigned) {
135 continue; 135 continue;
136 } 136 }
137 137
@@ -463,13 +463,13 @@ void NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing) {
463 std::scoped_lock lock{*applet_resource_holder.shared_mutex}; 463 std::scoped_lock lock{*applet_resource_holder.shared_mutex};
464 for (std::size_t aruid_index = 0; aruid_index < AruidIndexMax; ++aruid_index) { 464 for (std::size_t aruid_index = 0; aruid_index < AruidIndexMax; ++aruid_index) {
465 const auto* data = applet_resource_holder.applet_resource->GetAruidDataByIndex(aruid_index); 465 const auto* data = applet_resource_holder.applet_resource->GetAruidDataByIndex(aruid_index);
466 const auto aruid = data->aruid;
467 466
468 if (!data->flag.is_assigned) { 467 if (data == nullptr || !data->flag.is_assigned) {
469 continue; 468 continue;
470 } 469 }
471 470
472 bool is_set{}; 471 bool is_set{};
472 const auto aruid = data->aruid;
473 npad_resource.IsSupportedNpadStyleSet(is_set, aruid); 473 npad_resource.IsSupportedNpadStyleSet(is_set, aruid);
474 // Wait until style is defined 474 // Wait until style is defined
475 if (!is_set) { 475 if (!is_set) {