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.
This commit is contained in:
moneyl
2019-05-18 17:10:19 -04:00
parent d81254e389
commit 7e30ffe007

View File

@@ -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<IEntitySystemManager>().GetEntitySystem<AudioSystem>();
switch (step)