From d029fab8d31a0269ea9905a522c4ee3fa1029258 Mon Sep 17 00:00:00 2001 From: citRa <83618475+citRaTTV@users.noreply.github.com> Date: Thu, 10 Oct 2024 13:01:03 -0300 Subject: [PATCH] fix(storage/players): avoid json decoding error when a citizenid doesn't exist (#595) --- server/storage/players.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/storage/players.lua b/server/storage/players.lua index 673664b36..bd4d8adcc 100644 --- a/server/storage/players.lua +++ b/server/storage/players.lua @@ -112,7 +112,7 @@ end local function fetchPlayerEntity(citizenId) ---@type PlayerEntityDatabase local player = MySQL.single.await('SELECT citizenid, license, name, charinfo, money, job, gang, position, metadata, UNIX_TIMESTAMP(last_logged_out) AS lastLoggedOutUnix FROM players WHERE citizenid = ?', { citizenId }) - local charinfo = json.decode(player.charinfo) + local charinfo = player and json.decode(player.charinfo) return player and { citizenid = player.citizenid, license = player.license,