diff options
| author | crobibero <cody@robibe.ro> | 2020-11-20 10:35:46 -0700 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-11-20 10:35:46 -0700 |
| commit | 8f58f63b0886670922aa77431e69b80b969d675a (patch) | |
| tree | 9436313b2c5ca856f72eabba4606099c68665475 /Emby.Server.Implementations/Session/WebSocketController.cs | |
| parent | 53697ac39a624d3a32b79883f4e0321b3a7ecb49 (diff) | |
| parent | d2cef78db3c6f5c1063f8205ed5309f5243be66b (diff) | |
Merge remote-tracking branch 'upstream/master' into split-api
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 b986ffa1c..f9c6a13c6 100644 --- a/Emby.Server.Implementations/Session/WebSocketController.cs +++ b/Emby.Server.Implementations/Session/WebSocketController.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Net.WebSockets; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Common.Extensions; using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Session; using MediaBrowser.Model.Net; @@ -55,9 +56,9 @@ namespace Emby.Server.Implementations.Session connection.Closed += OnConnectionClosed; } - private void OnConnectionClosed(object sender, EventArgs e) + private void OnConnectionClosed(object? sender, EventArgs e) { - var connection = (IWebSocketConnection)sender; + var connection = sender as IWebSocketConnection ?? throw new ArgumentException($"{nameof(sender)} is not of type {nameof(IWebSocketConnection)}", nameof(sender)); _logger.LogDebug("Removing websocket from session {Session}", _session.Id); _sockets.Remove(connection); connection.Closed -= OnConnectionClosed; |
