From ffdd0aeea56493d8968f010afef143da2fd85aef Mon Sep 17 00:00:00 2001 From: Annastasia <112778590+Annalouu@users.noreply.github.com> Date: Sun, 26 Jan 2025 15:00:14 +0100 Subject: [PATCH] Added a check if the JOB is NIL When cops receive a notification and there is someone that is still in the character screen, it throws a nil job error since they didn't load their character yet. --- client/main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/client/main.lua b/client/main.lua index 65d08ff..21aa6be 100644 --- a/client/main.lua +++ b/client/main.lua @@ -125,6 +125,7 @@ end ---@param data string | table -- The player job or an array of jobs to check against ---@return boolean -- Returns true if the job is valid local function isJobValid(data) + if PlayerData.job == nil then return false end local jobType = PlayerData.job.type local jobName = PlayerData.job.name