From 0fa5a52caf5bb5242067ed2713ef4f8e43db7aff Mon Sep 17 00:00:00 2001 From: Kyle Date: Fri, 12 Feb 2021 01:20:25 +0800 Subject: [PATCH] Fix crash by nullptr --- extension.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extension.cpp b/extension.cpp index 7646ddb..82570e3 100644 --- a/extension.cpp +++ b/extension.cpp @@ -128,7 +128,7 @@ void TransmitManager::Hook_SetTransmit(CCheckTransmitInfo* pInfo, bool bAlways) RETURN_META(MRES_IGNORED); } - if (IsEntityIndexInRange(owner) && !g_Hooked[owner]->CanSee(client)) + if (IsEntityIndexInRange(owner) && g_Hooked[owner] != nullptr && !g_Hooked[owner]->CanSee(client)) { // blocked RETURN_META(MRES_SUPERCEDE); @@ -373,4 +373,4 @@ sp_nativeinfo_t g_Natives[] = {"TransmitManager_SetEntityOwner", Native_SetEntityOwner}, {"TransmitManager_SetEntityState", Native_SetEntityState}, {nullptr, nullptr}, -}; \ No newline at end of file +};