summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/patch.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/patch.h b/include/patch.h
index e67447d..e9e14f5 100644
--- a/include/patch.h
+++ b/include/patch.h
@@ -40,6 +40,11 @@ namespace libtp::patch
template<typename Func>
Func unhookFunction( Func trampoline )
{
+ if ( !trampoline )
+ {
+ return nullptr;
+ }
+
uint32_t* instructions = reinterpret_cast<uint32_t*>( trampoline );
// Restore the original instruction