From a11c4d0b0872096dadcedc321d600c5e4d31db90 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 9 Mar 2015 21:47:52 -0400 Subject: [PATCH] fix null reference in web socket connection --- .../Session/SessionWebSocketListener.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs index 72ec16f85d..7cbff9768d 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs @@ -99,6 +99,10 @@ namespace MediaBrowser.Server.Implementations.Session private Task GetSession(NameValueCollection queryString, string remoteEndpoint) { var token = queryString["api_key"]; + if (string.IsNullOrWhiteSpace(token)) + { + return Task.FromResult(null); + } return _sessionManager.GetSessionByAuthenticationToken(token, remoteEndpoint); }