Adds test to make sure that calling IComponent.HandleComponentState() with null states does not throw an exception.

Fixes state handling code on components to not throw exceptions when called with null components.
This commit is contained in:
Acruid
2020-02-09 02:28:47 -08:00
parent b554d8cc8c
commit d16f433f45
8 changed files with 96 additions and 13 deletions

View File

@@ -31,7 +31,8 @@ namespace Content.Client.GameObjects.Components.Mobs
{
base.HandleComponentState(curState, nextState);
var state = (CombatModeComponentState) curState;
if (!(curState is CombatModeComponentState state))
return;
IsInCombatMode = state.IsInCombatMode;
ActiveZone = state.TargetingZone;