소스 검색

fix null reference in web socket connection

Luke Pulverenti 10 년 전
부모
커밋
a11c4d0b08
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs

+ 4 - 0
MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs

@@ -99,6 +99,10 @@ namespace MediaBrowser.Server.Implementations.Session
         private Task<SessionInfo> GetSession(NameValueCollection queryString, string remoteEndpoint)
         {
             var token = queryString["api_key"];
+            if (string.IsNullOrWhiteSpace(token))
+            {
+                return Task.FromResult<SessionInfo>(null);
+            }
             return _sessionManager.GetSessionByAuthenticationToken(token, remoteEndpoint);
         }