From c5aee6b78d38df4d0ab01622e0df19b81c3c702f Mon Sep 17 00:00:00 2001 From: zykem <86602828+Zykem@users.noreply.github.com> Date: Sat, 26 Jul 2025 19:46:55 +0200 Subject: [PATCH] Validate identifier --- [core]/es_extended/server/functions.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/[core]/es_extended/server/functions.lua b/[core]/es_extended/server/functions.lua index b6a25a29..7ed694cd 100644 --- a/[core]/es_extended/server/functions.lua +++ b/[core]/es_extended/server/functions.lua @@ -371,7 +371,7 @@ function ESX.IsPlayerLoaded(source) end ---@param playerId number | string ----@return string? +---@return string function ESX.GetIdentifier(playerId) local fxDk = GetConvarInt("sv_fxdkMode", 0) if fxDk == 1 then @@ -382,7 +382,10 @@ function ESX.GetIdentifier(playerId) local identifierType = Config.Identifier local identifier = GetPlayerIdentifierByType(playerId, identifierType) - return identifier and identifier:gsub(("%s:"):format(identifierType), "") + + assert(identifier, ("[ESX] GetIdentifier failed: no identifier found for playerId %s with type '%s'"):format(playerId, identifierType)) + + return identifier:gsub(("%s:"):format(identifierType), "") end ---@param model string|number