From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Sun, 17 Mar 2024 01:10:59 +0000 (+1100) Subject: Fix presetidcard extended access throwing (#26195) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=677fd3c6db4550431d8801203c03aa2ab5075c29;p=space-station-14.git Fix presetidcard extended access throwing (#26195) --- 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);