mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
Fix nullref exception and added logging
This commit is contained in:
@@ -1726,6 +1726,7 @@ namespace Emby.Server.Implementations.Session
|
||||
string.Equals(i.Client, client));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public SessionInfo GetSessionByAuthenticationToken(AuthenticationInfo info, string deviceId, string remoteEndpoint, string appVersion)
|
||||
{
|
||||
if (info == null)
|
||||
@@ -1733,7 +1734,7 @@ namespace Emby.Server.Implementations.Session
|
||||
throw new ArgumentNullException(nameof(info));
|
||||
}
|
||||
|
||||
var user = info.UserId.Equals(Guid.Empty)
|
||||
var user = info.UserId == Guid.Empty
|
||||
? null
|
||||
: _userManager.GetUserById(info.UserId);
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Emby.Server.Implementations.Session
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogWarning("Unable to determine session based on url: {0}", e.Argument.Url);
|
||||
_logger.LogWarning("Unable to determine session based on query string: {0}", e.Argument.QueryString);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user