Browse Source

Fix null reference when request content type is application/x-www-form-urlencoded

bugfixin 6 năm trước cách đây
mục cha
commit
08d3a5d2fe
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  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));