The Free Software Media System - Server Backend & API
throw an exception when a session doesn't support remote control
Luke Pulverenti82ce0e17e959
diff --git a/MediaBrowser.Api/SessionsService.cs b/MediaBrowser.Api/SessionsService.csindex 923a704372..bdf01f5688 100644--- a/MediaBrowser.Api/SessionsService.cs+++ b/MediaBrowser.Api/SessionsService.cs@@ -121,6 +121,11 @@ namespace MediaBrowser.Apithrow new ResourceNotFoundException(string.Format("Session {0} not found.", request.Id));}+ if (!session.SupportsRemoteControl)+ {+ throw new ArgumentException(string.Format("Session {0} does not support remote control.", session.Id));+ }+var socket = session.WebSockets.OrderByDescending(i => i.LastActivityDate).FirstOrDefault(i => i.State == WebSocketState.Open);if (socket != null)