aboutsummaryrefslogtreecommitdiff
path: root/src/core/memory/cheat_engine.cpp
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-03-01 10:38:20 -0500
committerGitHub <noreply@github.com>2023-03-01 10:38:20 -0500
commit7b8304614ce6d374b7a38ea6456cf7a9f6445b87 (patch)
treee60a69f96d16d051220b66e90906a7abeacf1064 /src/core/memory/cheat_engine.cpp
parentcec37d97c3535d99a43b68a881c8bc0a5125f1de (diff)
parent91c597e869e655d28eb446dc05516dff5ef06bf7 (diff)
Merge pull request #9832 from liamwhite/hle-mp
service: HLE multiprocess
Diffstat (limited to 'src/core/memory/cheat_engine.cpp')
-rw-r--r--src/core/memory/cheat_engine.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/memory/cheat_engine.cpp b/src/core/memory/cheat_engine.cpp
index 44ee39648b..c2d96bbec4 100644
--- a/src/core/memory/cheat_engine.cpp
+++ b/src/core/memory/cheat_engine.cpp
@@ -47,8 +47,13 @@ void StandardVmCallbacks::MemoryWrite(VAddr address, const void* data, u64 size)
}
u64 StandardVmCallbacks::HidKeysDown() {
- const auto applet_resource =
- system.ServiceManager().GetService<Service::HID::Hid>("hid")->GetAppletResource();
+ const auto hid = system.ServiceManager().GetService<Service::HID::Hid>("hid");
+ if (hid == nullptr) {
+ LOG_WARNING(CheatEngine, "Attempted to read input state, but hid is not initialized!");
+ return 0;
+ }
+
+ const auto applet_resource = hid->GetAppletResource();
if (applet_resource == nullptr) {
LOG_WARNING(CheatEngine,
"Attempted to read input state, but applet resource is not initialized!");