Respond properly to null SSjob.get_department_type (#95048)

`get_department_type` can return null if all jobs in that department are
disabled. This can't happen in normal gameplay, but is being triggered
in event-base, which disables everything except assistant and cyborg.

This appears to be an expected invariant as job checks it within itself,
and even part of the department_order console code as well.
This commit is contained in:
Mothblocks
2026-01-30 19:57:47 -06:00
committed by GitHub
parent 0c75770b04
commit eeedcc9414
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -72,6 +72,8 @@
var/list/haters = list()
for(var/hater_department_type in list(/datum/job_department/security, /datum/job_department/command))
var/datum/job_department/hater_department = SSjob.get_department_type(hater_department_type)
if (isnull(hater_department))
continue
for(var/datum/job/hater_job as anything in hater_department.department_jobs)
haters += hater_job.title
var/datum/job/quartermaster/fucking_quartermaster = SSjob.get_job_type(/datum/job/quartermaster)