diff --git a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs index 6f5fc254fa..fb9227697a 100644 --- a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs @@ -78,7 +78,14 @@ namespace Content.Server.GameObjects } public T GetSlotItem(Slots slot) where T : ItemComponent { - return SlotContainers[slot].ContainedEntity?.GetComponent(); + var containedEntity = SlotContainers[slot].ContainedEntity; + if (containedEntity?.Deleted == true) + { + SlotContainers[slot] = null; + containedEntity = null; + Dirty(); + } + return containedEntity?.GetComponent(); } public bool TryGetSlotItem(Slots slot, out T itemComponent) where T : ItemComponent