forked from Qortal/qortal
Fix potential NPE when closing a websocket that failed to open properly
This commit is contained in:
parent
1b50dd5adf
commit
7562d9bbf8
@ -107,7 +107,9 @@ abstract class ApiWebSocket extends WebSocketServlet {
|
||||
|
||||
public void onWebSocketClose(Session session, int statusCode, String reason) {
|
||||
synchronized (SESSIONS_BY_CLASS) {
|
||||
SESSIONS_BY_CLASS.get(this.getClass()).remove(session);
|
||||
List<Session> sessions = SESSIONS_BY_CLASS.get(this.getClass());
|
||||
if (sessions != null)
|
||||
sessions.remove(session);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user