aboutsummaryrefslogtreecommitdiff
path: root/primedev/core/hooks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'primedev/core/hooks.cpp')
-rw-r--r--primedev/core/hooks.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/primedev/core/hooks.cpp b/primedev/core/hooks.cpp
index 20f0cbef..6e849291 100644
--- a/primedev/core/hooks.cpp
+++ b/primedev/core/hooks.cpp
@@ -104,7 +104,9 @@ bool ManualHook::Dispatch(LPVOID addr, LPVOID* orig)
if (orig)
ppOrigFunc = orig;
- if (MH_CreateHook(addr, pHookFunc, ppOrigFunc) == MH_OK)
+ if (!addr)
+ spdlog::error("Address for hook {} is invalid", pFuncName);
+ else if (MH_CreateHook(addr, pHookFunc, ppOrigFunc) == MH_OK)
{
if (MH_EnableHook(addr) == MH_OK)
{