Fix nullref exception and added logging

This commit is contained in:
Bond_009
2019-12-26 20:57:46 +01:00
parent 976459d3e8
commit 5ca68f9623
6 changed files with 41 additions and 65 deletions

View File

@@ -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 />