From 2485decaed5a63cde3eb8a4bef81a9111bdc86a5 Mon Sep 17 00:00:00 2001 From: trevan Date: Tue, 8 Dec 2020 17:59:42 -0700 Subject: [PATCH] Ensure the player name in the step definition is valid (#8384) --- .../strategy/engine/data/gameparser/GameParser.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/game-core/src/main/java/games/strategy/engine/data/gameparser/GameParser.java b/game-core/src/main/java/games/strategy/engine/data/gameparser/GameParser.java index 66d6e5893c0..ddbd10996a1 100644 --- a/game-core/src/main/java/games/strategy/engine/data/gameparser/GameParser.java +++ b/game-core/src/main/java/games/strategy/engine/data/gameparser/GameParser.java @@ -555,6 +555,16 @@ private void parseSteps(final List stepList) throws Game for (final GamePlay.Sequence.Step current : stepList) { final IDelegate delegate = getDelegate(current.getDelegate()); final GamePlayer player = getPlayerIdOptional(current.getPlayer()).orElse(null); + if (player == null && current.getPlayer() != null && !current.getPlayer().isBlank()) { + log.log( + Level.SEVERE, + "The step " + + current.getName() + + " wants a player with the name of '" + + current.getPlayer() + + "' but that player can not be found. " + + "Make sure the player's name is spelled correctly."); + } final String name = current.getName(); String displayName = null; final Properties stepProperties = parseStepProperties(current.getStepProperties());