From 4ea3e8de1dd855e400dcee0ab42490e2ffc879bc Mon Sep 17 00:00:00 2001 From: Contrabang <91113370+Contrabang@users.noreply.github.com> Date: Tue, 3 Oct 2023 12:45:21 -0400 Subject: [PATCH] fix (#22679) --- code/controllers/subsystem/SSjobs.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/controllers/subsystem/SSjobs.dm b/code/controllers/subsystem/SSjobs.dm index df1e5a16238..4b9c30ed143 100644 --- a/code/controllers/subsystem/SSjobs.dm +++ b/code/controllers/subsystem/SSjobs.dm @@ -109,12 +109,14 @@ SUBSYSTEM_DEF(jobs) /datum/controller/subsystem/jobs/proc/FreeRole(rank, force = FALSE) //making additional slot on the fly var/datum/job/job = GetJob(rank) + if(!job) + return FALSE if(job.job_banned_gamemode) if(!force) return FALSE job.job_banned_gamemode = FALSE // If admins want to force it, they can reopen banned job slots - if(job && job.current_positions >= job.total_positions && job.total_positions != -1) + if(job.current_positions >= job.total_positions && job.total_positions != -1) job.total_positions++ return TRUE return FALSE