From c5828f50d39fecb5b3eeb521091ace4a82e2cc10 Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Wed, 18 Sep 2024 22:36:39 -0400 Subject: [PATCH] Update InternalEncryptionKeySpawner.cs --- Content.Server/Silicon/IPC/InternalEncryptionKeySpawner.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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;