summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-02-19 21:29:42 +0100
committerLiam <byteslice@airmail.cc>2023-02-21 18:19:25 +0100
commit87749d217e40d5aa785ced258c260aac6ab79ae9 (patch)
treedc27abacdae692f404e267a61a0f670dcc3a8da0 /src
parentsm:: support service registration deferral (diff)
downloadyuzu-87749d217e40d5aa785ced258c260aac6ab79ae9.tar
yuzu-87749d217e40d5aa785ced258c260aac6ab79ae9.tar.gz
yuzu-87749d217e40d5aa785ced258c260aac6ab79ae9.tar.bz2
yuzu-87749d217e40d5aa785ced258c260aac6ab79ae9.tar.lz
yuzu-87749d217e40d5aa785ced258c260aac6ab79ae9.tar.xz
yuzu-87749d217e40d5aa785ced258c260aac6ab79ae9.tar.zst
yuzu-87749d217e40d5aa785ced258c260aac6ab79ae9.zip
Diffstat (limited to '')
-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 44ee39648..c2d96bbec 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!");