Fix presetidcard extended access throwing (#26195)

This commit is contained in:
metalgearsloth
2024-03-17 12:10:59 +11:00
committed by GitHub
parent 03b5c21b6e
commit 677fd3c6db

View File

@@ -50,8 +50,10 @@ public sealed class PresetIdCardSystem : EntitySystem
var station = _stationSystem.GetOwningStation(uid);
var extended = false;
if (station != null)
extended = Comp<StationJobsComponent>(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);