diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Session/SessionManager.cs | 9 | ||||
| -rw-r--r-- | MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs | 7 |
2 files changed, 15 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs index 77843ef6b2..4386b785ad 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs @@ -404,6 +404,10 @@ namespace MediaBrowser.Server.Implementations.Session /// <returns>SessionInfo.</returns> private async Task<SessionInfo> GetSessionInfo(string appName, string appVersion, string deviceId, string deviceName, string remoteEndPoint, User user) { + if (string.IsNullOrWhiteSpace(deviceId)) + { + throw new ArgumentNullException("deviceId"); + } var key = GetSessionKey(appName, deviceId); await _sessionLock.WaitAsync(CancellationToken.None).ConfigureAwait(false); @@ -1748,6 +1752,11 @@ namespace MediaBrowser.Server.Implementations.Session public void ReportNowViewingItem(string sessionId, string itemId) { + if (string.IsNullOrWhiteSpace(itemId)) + { + throw new ArgumentNullException("itemId"); + } + var item = _libraryManager.GetItemById(new Guid(itemId)); var info = GetItemInfo(item, null, null); diff --git a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs index 602bc4876b..ddd7ba53a6 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs @@ -230,7 +230,12 @@ namespace MediaBrowser.Server.Implementations.Session { var vals = message.Data.Split('|'); - _sessionManager.ReportNowViewingItem(session.Id, vals[1]); + var itemId = vals[1]; + + if (!string.IsNullOrWhiteSpace(itemId)) + { + _sessionManager.ReportNowViewingItem(session.Id, itemId); + } } } |
