Skip to content

Commit

Permalink
fix(server/functions): handle nil player names and fallback to citizenid
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniGP17 committed Nov 20, 2024
1 parent 05bac43 commit eaf2719
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eaf2719

Please sign in to comment.