From 82ce0e17e95967109832843cbfb570a772719401 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 26 May 2013 21:23:46 -0400 Subject: [PATCH] throw an exception when a session doesn't support remote control --- MediaBrowser.Api/SessionsService.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MediaBrowser.Api/SessionsService.cs b/MediaBrowser.Api/SessionsService.cs index 923a70437..bdf01f568 100644 --- a/MediaBrowser.Api/SessionsService.cs +++ b/MediaBrowser.Api/SessionsService.cs @@ -121,6 +121,11 @@ namespace MediaBrowser.Api throw 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)