diff options
| author | Bond_009 <bond.009@outlook.com> | 2019-12-26 20:57:46 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2020-01-13 20:06:08 +0100 |
| commit | 5ca68f9623e414b85ddbda1f97895f1b90bd05e0 (patch) | |
| tree | 8360af78a08b0b84b2a4854e35df1ab5e55f6c80 /Emby.Server.Implementations/Session/WebSocketController.cs | |
| parent | 976459d3e8a8b889cebc2cf281e38b0fbc19c9b9 (diff) | |
Fix nullref exception and added logging
Diffstat (limited to 'Emby.Server.Implementations/Session/WebSocketController.cs')
| -rw-r--r-- | Emby.Server.Implementations/Session/WebSocketController.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Session/WebSocketController.cs b/Emby.Server.Implementations/Session/WebSocketController.cs index c17e67da9..536013c7a 100644 --- a/Emby.Server.Implementations/Session/WebSocketController.cs +++ b/Emby.Server.Implementations/Session/WebSocketController.cs @@ -53,11 +53,12 @@ namespace Emby.Server.Implementations.Session private void OnConnectionClosed(object sender, EventArgs e) { - _logger.LogDebug("Removing websocket from session {Session}", _session.Id); var connection = (IWebSocketConnection)sender; + _logger.LogDebug("Removing websocket from session {Session}", _session.Id); _sockets.Remove(connection); - _sessionManager.CloseIfNeeded(_session); + connection.Closed -= OnConnectionClosed; connection.Dispose(); + _sessionManager.CloseIfNeeded(_session); } /// <inheritdoc /> |
