From f9475ec64c9184cfc2967d4becd8b61979e3be5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Horv=C3=A1th=20Gell=C3=A9rt?= Date: Wed, 28 Jun 2023 01:59:19 +0200 Subject: [PATCH] :pencil2: fix(es_extended/functions.lua) handle args.playerId is nil --- [core]/es_extended/server/functions.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/[core]/es_extended/server/functions.lua b/[core]/es_extended/server/functions.lua index 973ca661..b77c713f 100644 --- a/[core]/es_extended/server/functions.lua +++ b/[core]/es_extended/server/functions.lua @@ -131,6 +131,10 @@ function ESX.RegisterCommand(name, group, cb, allowConsole, suggestion) xPlayer.showNotification(error) end else + if ESX.Table.SizeOf(args) == 0 then + xPlayer.showNotification(TranslateCap('commanderror_invalidplayerid')) + return + end cb(xPlayer or false, args, function(msg) if playerId == 0 then print(('[^3WARNING^7] %s^7'):format(msg))