From b6e1c4debaf79e9a03118d501e208dcc38e70ad0 Mon Sep 17 00:00:00 2001 From: Canis_Lupus <56067968+CanysLypys@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:58:27 +0200 Subject: [PATCH] Updating getNearbyPlayers - Added an 'early' return with an empty table if the source or the playerCoord are not given. --- [core]/es_extended/server/onesync.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/[core]/es_extended/server/onesync.lua b/[core]/es_extended/server/onesync.lua index 19fb2eab..eec847ba 100644 --- a/[core]/es_extended/server/onesync.lua +++ b/[core]/es_extended/server/onesync.lua @@ -15,12 +15,14 @@ local function getNearbyPlayers(source, closest, distance, ignore) if not source then error("Received invalid first argument (source); should be playerId") + return result end playerCoords = GetEntityCoords(playerPed) if not playerCoords then error("Received nil value (playerCoords); perhaps source is nil at first place?") + return result end end