diff --git a/Content.Server/Silicon/IPC/InternalEncryptionKeySpawner.cs b/Content.Server/Silicon/IPC/InternalEncryptionKeySpawner.cs index 7f5d216c92f..e6c7f78fe5a 100644 --- a/Content.Server/Silicon/IPC/InternalEncryptionKeySpawner.cs +++ b/Content.Server/Silicon/IPC/InternalEncryptionKeySpawner.cs @@ -2,7 +2,6 @@ using Content.Shared.Radio.Components; using Content.Shared.Containers; using Robust.Shared.Containers; -using Content.Server.Cargo.Components; namespace Content.Server.Silicon.IPC; public sealed partial class InternalEncryptionKeySpawner : EntitySystem @@ -10,7 +9,9 @@ public sealed partial class InternalEncryptionKeySpawner : EntitySystem [Dependency] private readonly SharedContainerSystem _container = default!; public void TryInsertEncryptionKey(EntityUid target, StartingGearPrototype startingGear, IEntityManager entityManager) { - if (!TryComp(target, out var keyHolderComp) + if (target == null // For whatever ungodly reason, StationSpawningSystem **absolutely has to assert that a nullable Uid is not null**. This causes random test fails. + || !TryComp(target, out var keyHolderComp) + || keyHolderComp is null || !startingGear.Equipment.TryGetValue("ears", out var earEquipString) || string.IsNullOrEmpty(earEquipString)) return;