diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/BattlefieldThaumaturge.java b/Mage.Sets/src/mage/sets/journeyintonyx/BattlefieldThaumaturge.java index 1a007690b9..2fed4c52a7 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/BattlefieldThaumaturge.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/BattlefieldThaumaturge.java @@ -123,7 +123,7 @@ class BattlefieldThaumaturgeSpellsCostReductionEffect extends CostModificationEf if ((abilityToModify instanceof SpellAbility) && abilityToModify.getControllerId().equals(source.getControllerId())) { Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); - return spell != null && this.filter.match(spell, game); + return spell != null && BattlefieldThaumaturgeSpellsCostReductionEffect.filter.match(spell, game); } return false; } diff --git a/Mage/src/mage/game/GameCommanderImpl.java b/Mage/src/mage/game/GameCommanderImpl.java index 648c8bea9a..3fc18e5704 100644 --- a/Mage/src/mage/game/GameCommanderImpl.java +++ b/Mage/src/mage/game/GameCommanderImpl.java @@ -204,7 +204,7 @@ public abstract class GameCommanderImpl extends GameImpl { @Override public Set getOpponents(UUID playerId) { - Set opponents = new HashSet(); + Set opponents = new HashSet<>(); for (UUID opponentId: this.getPlayer(playerId).getInRange()) { if (!opponentId.equals(playerId)) { opponents.add(opponentId); diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index f0e9d26c87..45341f6cf0 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -937,11 +937,16 @@ public abstract class GameImpl implements Game, Serializable { @Override public synchronized void quit(UUID playerId) { - Player player = state.getPlayer(playerId); - if (player != null) { - player.quit(this); - }else { - logger.error(new StringBuilder("quit - player not found - playerId: ").append(playerId)); + if (state != null) { + Player player = state.getPlayer(playerId); + if (player != null) { + logger.debug(player.getName() + " quits the game"); + player.quit(this); + }else { + logger.error(new StringBuilder("quit - player not found - playerId: ").append(playerId)); + } + } else { + logger.error(new StringBuilder("quit - state not found - playerId: ").append(playerId)); } } @@ -1841,7 +1846,7 @@ public abstract class GameImpl implements Game, Serializable { @Override public void leave(UUID playerId) { Player player = getPlayer(playerId); - if (player.hasLeft()) { + if (player == null || player.hasLeft()) { return; } player.leave();