diff --git a/Mage.Server/src/main/java/mage/server/ChatSession.java b/Mage.Server/src/main/java/mage/server/ChatSession.java index da9b897f7e..e73c0410f1 100644 --- a/Mage.Server/src/main/java/mage/server/ChatSession.java +++ b/Mage.Server/src/main/java/mage/server/ChatSession.java @@ -90,8 +90,8 @@ public class ChatSession { String userName = clients.get(userId); if (reason != DisconnectReason.LostConnection) { // for lost connection the user will be reconnected or session expire so no removeUserFromAllTablesAndChat of chat yet final Lock w = lock.writeLock(); - w.lock(); try { + w.lock(); clients.remove(userId); } finally { w.unlock(); diff --git a/Mage.Server/src/main/java/mage/server/UserManager.java b/Mage.Server/src/main/java/mage/server/UserManager.java index cd30111745..767f7bb59a 100644 --- a/Mage.Server/src/main/java/mage/server/UserManager.java +++ b/Mage.Server/src/main/java/mage/server/UserManager.java @@ -231,8 +231,8 @@ public enum UserManager { } logger.debug("Users to remove " + toRemove.size()); final Lock w = lock.readLock(); - w.lock(); try { + w.lock(); for (User user : toRemove) { users.remove(user.getId()); }