Fix nullability errors in Emby.Server.Implementations

This commit is contained in:
crobibero
2020-11-13 09:41:18 -07:00
parent d5e2369dd6
commit 7bf320922c
3 changed files with 19 additions and 3 deletions

View File

@@ -55,8 +55,13 @@ namespace Emby.Server.Implementations.Session
connection.Closed += OnConnectionClosed;
}
private void OnConnectionClosed(object sender, EventArgs e)
private void OnConnectionClosed(object? sender, EventArgs e)
{
if (sender == null)
{
throw new NullReferenceException(nameof(sender));
}
var connection = (IWebSocketConnection)sender;
_logger.LogDebug("Removing websocket from session {Session}", _session.Id);
_sockets.Remove(connection);