Add null check to avoid NPE

Fixes bug 735
This commit is contained in:
dripton
2013-09-05 23:07:53 +00:00
parent 6b4de9833f
commit 3ae5b4cd80

View File

@@ -355,7 +355,7 @@ public class Player extends GameEntity implements Comparable<Player> {
} }
public boolean isOpponentOf(Player other) { public boolean isOpponentOf(Player other) {
return other != this && ( other.teamNumber < 0 || other.teamNumber != this.teamNumber ); return other != this && other != null && ( other.teamNumber < 0 || other.teamNumber != this.teamNumber );
} }