From 677fd3c6db4550431d8801203c03aa2ab5075c29 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Sun, 17 Mar 2024 12:10:59 +1100 Subject: [PATCH] Fix presetidcard extended access throwing (#26195) --- Content.Server/Access/Systems/PresetIdCardSystem.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Content.Server/Access/Systems/PresetIdCardSystem.cs b/Content.Server/Access/Systems/PresetIdCardSystem.cs index 4073b4baa2..696b7a1dcf 100644 --- a/Content.Server/Access/Systems/PresetIdCardSystem.cs +++ b/Content.Server/Access/Systems/PresetIdCardSystem.cs @@ -50,8 +50,10 @@ public sealed class PresetIdCardSystem : EntitySystem var station = _stationSystem.GetOwningStation(uid); var extended = false; - if (station != null) - extended = Comp(station.Value).ExtendedAccess; + + // Station not guaranteed to have jobs (e.g. nukie outpost). + if (TryComp(station, out StationJobsComponent? stationJobs)) + extended = stationJobs.ExtendedAccess; SetupIdAccess(uid, id, extended); SetupIdName(uid, id); -- 2.52.0