diff options
| author | Bond-009 <bond.009@outlook.com> | 2019-04-24 14:54:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-24 14:54:18 +0200 |
| commit | a0e61ee67f56a6f2735c3f3e8f97e3da794c0c1a (patch) | |
| tree | d045295c3b725e42a80acb48ad4ccf566b676f4f | |
| parent | a8da122fb3c9c1f66f43da01099fb6aa86d554c6 (diff) | |
| parent | 08d3a5d2feafe9d54c354028f38d7cfa4e94293c (diff) | |
Merge pull request #1274 from bugfixin/content-type-fix
Prevent null reference when request content type is x-www-form-urlencoded
| -rw-r--r-- | Emby.Server.Implementations/Services/ServiceHandler.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/Services/ServiceHandler.cs b/Emby.Server.Implementations/Services/ServiceHandler.cs index 621be4fcb..d32fce1c7 100644 --- a/Emby.Server.Implementations/Services/ServiceHandler.cs +++ b/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)); |
