diff --git a/Mage.Server/src/main/java/mage/server/SessionManager.java b/Mage.Server/src/main/java/mage/server/SessionManager.java index 9b9a7fa07b..66d9c7d8e1 100644 --- a/Mage.Server/src/main/java/mage/server/SessionManager.java +++ b/Mage.Server/src/main/java/mage/server/SessionManager.java @@ -26,7 +26,7 @@ public enum SessionManager { logger.trace("Session with sessionId " + sessionId + " is not found"); return Optional.empty(); } - if (session.getUserId() != null && UserManager.instance.getUser(session.getUserId()) == null) { + if (session.getUserId() != null && !UserManager.instance.getUser(session.getUserId()).isPresent()) { logger.error("User for session " + sessionId + " with userId " + session.getUserId() + " is missing. Session removed."); // can happen if user from same host signs in multiple time with multiple clients, after he disconnects with one client disconnect(sessionId, DisconnectReason.ConnectingOtherInstance);