aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Session
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-05-30 14:22:12 -0400
committerLuke <luke.pulverenti@gmail.com>2016-05-30 14:22:12 -0400
commit47dbd1c1b22173e968419c22c1313c59f8fd08e1 (patch)
tree73e45e643f0aa8e20a05efd55327fa6619100500 /MediaBrowser.Server.Implementations/Session
parent776133e95f75892c32bdca8dac479ece7ab0c790 (diff)
parentf091e6f55f741e2ebd9a818a837c1950c49c1967 (diff)
Merge pull request #1792 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session')
-rw-r--r--MediaBrowser.Server.Implementations/Session/SessionManager.cs9
-rw-r--r--MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs7
2 files changed, 15 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs
index 77843ef6b..4386b785a 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 602bc4876..ddd7ba53a 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);
+ }
}
}