]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix presetidcard extended access throwing (#26195)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Sun, 17 Mar 2024 01:10:59 +0000 (12:10 +1100)
committerGitHub <noreply@github.com>
Sun, 17 Mar 2024 01:10:59 +0000 (21:10 -0400)
Content.Server/Access/Systems/PresetIdCardSystem.cs

index 4073b4baa2899f1d84fd8797381d7bdbc87a116e..696b7a1dcfd2a8c52adbc522c03d519fb6e75528 100644 (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);