Skip to content

Commit

Permalink
refactor(es_extended/server/classes/player): add error msg for invali…
Browse files Browse the repository at this point in the history
…d functions
  • Loading branch information
Kenshiin13 committed Jan 22, 2025
1 parent 4c9a7d2 commit 54e0da8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions [core]/es_extended/server/classes/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,10 @@ local function runStaticPlayerMethod(src, method, ...)
return
end

if not ESX.IsFunctionReference(xPlayer[method]) then
error(("Attempted to call invalid method on playerId %s: %s"):format(src, method))
end

return xPlayer[method](...)
end
exports("RunStaticPlayerMethod", runStaticPlayerMethod)

0 comments on commit 54e0da8

Please sign in to comment.