From 7e30ffe0071881e9cfce7674dbb0662f68138d92 Mon Sep 17 00:00:00 2001 From: moneyl <8206401+Moneyl@users.noreply.github.com> Date: Sat, 18 May 2019 17:10:19 -0400 Subject: [PATCH] Fixes server crash due to null construction step ConstructionComponent.AttackBy tries calling TryProcessStep on the forward step of the construction stage, and if that fails it tries the backwards step. I many construction prototypes the backwards step is null for all stages and so clicking the construction ghost with an invalid step results in a crash due to the step passed to TryProcessStep being null. --- .../Components/Construction/ConstructionComponent.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs index 18d8072b38..c6e8d3f656 100644 --- a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs +++ b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs @@ -93,6 +93,10 @@ namespace Content.Server.GameObjects.Components.Construction bool TryProcessStep(ConstructionStep step, IEntity slapped) { + if (step == null) + { + return false; + } var sound = IoCManager.Resolve().GetEntitySystem(); switch (step)