Fixed an Optional<> bug of GameController.
@@ -44,7 +44,6 @@ import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.zip.GZIPOutputStream;
-
import mage.MageException;
import mage.abilities.Ability;
import mage.cards.Card;
@@ -350,8 +349,9 @@ public class GameController implements GameCallback {
private void sendInfoAboutPlayersNotJoinedYet() {
for (Player player : game.getPlayers().values()) {
if (!player.hasLeft() && player.isHuman()) {
- User user = getUserByPlayerId(player.getId()).get();
- if (user != null) {
+ Optional<User> requestedUser = getUserByPlayerId(player.getId());
+ if (requestedUser.isPresent()) {
+ User user = requestedUser.get();
if (!user.isConnected()) {
if (gameSessions.get(player.getId()) == null) {
// join the game because player has not joined are was removed because of disconnect
