diff options
author | K900 <me@0upti.me> | 2024-01-27 17:32:49 +0300 |
---|---|---|
committer | K900 <me@0upti.me> | 2024-01-27 17:32:49 +0300 |
commit | 8b4746558674123405c18df246b90784be28cc6b (patch) | |
tree | c7a7d4f88d74e21a29a1d1fc69a1c5b75455e4e5 | |
parent | 3065ab0fd861ce7f394425dd72baa16f29b4d09d (diff) |
input: add a missing null pointer check
There's a few other places where the result of GetAruidData is accessed without a null check,
but I couldn't find a code path that hits those.
-rw-r--r-- | src/hid_core/resources/abstracted_pad/abstract_properties_handler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hid_core/resources/abstracted_pad/abstract_properties_handler.cpp b/src/hid_core/resources/abstracted_pad/abstract_properties_handler.cpp index 4897a2784..36b630c7f 100644 --- a/src/hid_core/resources/abstracted_pad/abstract_properties_handler.cpp +++ b/src/hid_core/resources/abstracted_pad/abstract_properties_handler.cpp @@ -137,7 +137,7 @@ void NpadAbstractPropertiesHandler::UpdateAllDeviceProperties() { const auto npad_index = NpadIdTypeToIndex(npad_id_type); for (std::size_t aruid_index = 0; aruid_index < AruidIndexMax; aruid_index++) { auto* data = applet_resource_holder->applet_resource->GetAruidData(aruid_index); - if (!data->flag.is_assigned) { + if (data == nullptr || !data->flag.is_assigned) { continue; } auto& npad_entry = data->shared_memory_format->npad.npad_entry[npad_index]; |