소스 검색

Merge pull request #1274 from bugfixin/content-type-fix

Prevent null reference when request content type is x-www-form-urlencoded
Bond-009 6 년 전
부모
커밋
a0e61ee67f
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      Emby.Server.Implementations/Services/ServiceHandler.cs

+ 4 - 1
Emby.Server.Implementations/Services/ServiceHandler.cs

@@ -26,7 +26,10 @@ namespace Emby.Server.Implementations.Services
             if (!string.IsNullOrEmpty(contentType) && httpReq.ContentLength > 0)
             {
                 var deserializer = RequestHelper.GetRequestReader(host, contentType);
-                return deserializer?.Invoke(requestType, httpReq.InputStream);
+                if (deserializer != null)
+                {
+                    return deserializer.Invoke(requestType, httpReq.InputStream);
+                }
             }
 
             return Task.FromResult(host.CreateInstance(requestType));