From eeaf2284cdf03eeeb632c48a59c97379e2a9687e Mon Sep 17 00:00:00 2001 From: Ingmar Goudt Date: Thu, 27 Sep 2018 11:05:23 +0200 Subject: [PATCH] fix a nullcheck of an Optional.. --- Mage.Server/src/main/java/mage/server/SessionManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);