diff options
author | Pacien TRAN-GIRARD | 2016-03-16 06:55:13 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2016-03-16 06:55:13 +0100 |
commit | 6f3a8a0946946e28213967a98b5f080e3cb2a5e1 (patch) | |
tree | e38d3d6c94720d1a29df40abc7b77313e3d602b9 /src | |
parent | aa317f43ad2c714cecbae5202bcfc2c2ab68172e (diff) | |
download | xblast-6f3a8a0946946e28213967a98b5f080e3cb2a5e1.tar.gz |
Add null and empty list check
Diffstat (limited to 'src')
-rw-r--r-- | src/ch/epfl/xblast/server/GameState.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ch/epfl/xblast/server/GameState.java b/src/ch/epfl/xblast/server/GameState.java index 6e7f8c4..0512510 100644 --- a/src/ch/epfl/xblast/server/GameState.java +++ b/src/ch/epfl/xblast/server/GameState.java | |||
@@ -289,6 +289,8 @@ public final class GameState { | |||
289 | * @return the highest priority player | 289 | * @return the highest priority player |
290 | */ | 290 | */ |
291 | private PlayerID resolveConflict(List<PlayerID> claimants) { | 291 | private PlayerID resolveConflict(List<PlayerID> claimants) { |
292 | if (claimants == null || claimants.isEmpty()) throw new IllegalArgumentException(); | ||
293 | |||
292 | return this.currentPlayerPriorityOrder() | 294 | return this.currentPlayerPriorityOrder() |
293 | .stream() | 295 | .stream() |
294 | .filter(claimants::contains) | 296 | .filter(claimants::contains) |