diff --git a/Content.Server/GameObjects/ContainerSlot.cs b/Content.Server/GameObjects/ContainerSlot.cs index 390342b523..939a409a25 100644 --- a/Content.Server/GameObjects/ContainerSlot.cs +++ b/Content.Server/GameObjects/ContainerSlot.cs @@ -1,4 +1,5 @@ -using Robust.Server.GameObjects.Components.Container; +using System; +using Robust.Server.GameObjects.Components.Container; using Robust.Server.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects; using System.Collections.Generic; @@ -12,7 +13,18 @@ namespace Content.Server.GameObjects public IEntity ContainedEntity { get; private set; } = null; /// - public override IReadOnlyCollection ContainedEntities => new List { ContainedEntity }.AsReadOnly(); + public override IReadOnlyCollection ContainedEntities + { + get + { + if (ContainedEntity == null) + { + return Array.Empty(); + } + + return new List {ContainedEntity}.AsReadOnly(); + } + } public ContainerSlot(string id, IContainerManager manager) : base(id, manager) {