From 6f3a8a0946946e28213967a98b5f080e3cb2a5e1 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Wed, 16 Mar 2016 06:55:13 +0100 Subject: Add null and empty list check --- src/ch/epfl/xblast/server/GameState.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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 { * @return the highest priority player */ private PlayerID resolveConflict(List claimants) { + if (claimants == null || claimants.isEmpty()) throw new IllegalArgumentException(); + return this.currentPlayerPriorityOrder() .stream() .filter(claimants::contains) -- cgit v1.2.3