Fix NPE in MountCannonGoal

This commit is contained in:
Shaun Bennett 2016-03-30 22:33:23 +11:00
parent 5149043d14
commit 5652eb75cf
1 changed files with 4 additions and 1 deletions

View File

@ -33,7 +33,10 @@ public class MountCannonGoal extends ObjectiveGoal<AttackEnemyObjective>
@Override
protected void clean(Player player, TutorialRegion region)
{
getObjective().getCannons().remove(player.getName()).kill();
// This cannon could be removed from the tutorial already in BlowUpWallGoal, we need to check if its null
Cannon cannon = getObjective().getCannons().remove(player.getName());
if (cannon != null)
cannon.kill();
}
@Override