aboutsummaryrefslogtreecommitdiff
path: root/src/ch
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2016-03-16 06:55:13 +0100
committerPacien TRAN-GIRARD2016-03-16 06:55:13 +0100
commit6f3a8a0946946e28213967a98b5f080e3cb2a5e1 (patch)
treee38d3d6c94720d1a29df40abc7b77313e3d602b9 /src/ch
parentaa317f43ad2c714cecbae5202bcfc2c2ab68172e (diff)
downloadxblast-6f3a8a0946946e28213967a98b5f080e3cb2a5e1.tar.gz
Add null and empty list check
Diffstat (limited to 'src/ch')
-rw-r--r--src/ch/epfl/xblast/server/GameState.java2
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)