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 17:57:47 -08:00
committed by GitHub
parent 0c75770b04
commit eeedcc9414
2 changed files with 4 additions and 0 deletions
@@ -48,6 +48,8 @@ GLOBAL_VAR(department_cd_override)
/datum/computer_file/program/department_order/proc/set_linked_department(datum/job_department/department)
linked_department = department
var/datum/job_department/linked_department_real = SSjob.get_department_type(linked_department)
if (isnull(linked_department_real))
return
// Heads of staff can download
LAZYOR(download_access, linked_department_real.head_of_staff_access)
// Heads of staff + anyone in the dept can run it