From eaf27192e986417458685059334cea2bceed417f Mon Sep 17 00:00:00 2001 From: Dani <96537843+DaniGP17@users.noreply.github.com> Date: Wed, 20 Nov 2024 10:10:27 +0100 Subject: [PATCH] fix(server/functions): handle nil player names and fallback to citizenid --- server/functions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/functions.lua b/server/functions.lua index 3c4ad40d..373ffb78 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -84,7 +84,7 @@ function LoadInventory(source, citizenid) end if #missingItems > 0 then - print(('The following items were removed for player %s as they no longer exist: %s'):format(GetPlayerName(source), table.concat(missingItems, ', '))) + print(('The following items were removed for player %s as they no longer exist: %s'):format(source and GetPlayerName(source) or citizenid, table.concat(missingItems, ', '))) end return loadedInventory