diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java index f46035195..4200bfe5d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java @@ -87,12 +87,15 @@ public class MySQLGuacamoleSocket implements GuacamoleSocket { @Override public void close() throws GuacamoleException { - // Close socket - socket.close(); - // Mark this connection as inactive synchronized (activeConnectionMap) { - activeConnectionMap.closeConnection(historyID, connectionGroupID); + + if (isOpen()) + activeConnectionMap.closeConnection(historyID, connectionGroupID); + + // Close socket + socket.close(); + } }