fix possible null reference exceptions
This commit is contained in:
@@ -17,6 +17,7 @@ namespace OpenRA.Mods.Common.AI
|
|||||||
|
|
||||||
public void Update(Squad squad)
|
public void Update(Squad squad)
|
||||||
{
|
{
|
||||||
|
if (currentState != null)
|
||||||
currentState.Tick(squad);
|
currentState.Tick(squad);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,6 +32,7 @@ namespace OpenRA.Mods.Common.AI
|
|||||||
if (newState != null)
|
if (newState != null)
|
||||||
currentState = newState;
|
currentState = newState;
|
||||||
|
|
||||||
|
if (currentState != null)
|
||||||
currentState.Activate(squad);
|
currentState.Activate(squad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user